Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

IsFirstTickOfBar triggering each 15 seconds

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    IsFirstTickOfBar triggering each 15 seconds

    Hi,

    I put your sample indicator IsFirstTickOfBarAddedSeriesTest on GBPUSD 1 minute chart. I activated Show Tick Replay in the General Options->Market Data and Tick Replay on my data serie.

    Why I receive OnBarUpdate event each 15 seconds with IsFirstTickOfBar = true ? This is the result from my script output window:

    2020-09-16 10:54:45 | State: Realtime, BIP: 1, IsFirstTickOfBar: True, Bars TickCount: 1, Volume[0]: 11, BarsInProgress: 1, NewBar: True
    2020-09-16 10:55:00 | State: Realtime, BIP: 1, IsFirstTickOfBar: True, Bars TickCount: 1, Volume[0]: 2, BarsInProgress: 1, NewBar: True
    2020-09-16 10:55:15 | State: Realtime, BIP: 1, IsFirstTickOfBar: True, Bars TickCount: 1, Volume[0]: 12, BarsInProgress: 1, NewBar: True
    2020-09-16 10:55:30 | State: Realtime, BIP: 1, IsFirstTickOfBar: True, Bars TickCount: 1, Volume[0]: 1, BarsInProgress: 1, NewBar: True
    2020-09-16 10:55:45 | State: Realtime, BIP: 1, IsFirstTickOfBar: True, Bars TickCount: 1, Volume[0]: 8, BarsInProgress: 1, NewBar: True
    2020-09-16 10:56:00 | State: Realtime, BIP: 1, IsFirstTickOfBar: True, Bars TickCount: 1, Volume[0]: 27, BarsInProgress: 1, NewBar: True
    2020-09-16 10:56:15 | State: Realtime, BIP: 1, IsFirstTickOfBar: True, Bars TickCount: 1, Volume[0]: 2, BarsInProgress: 1, NewBar: True

    Than you for your help.
    Last edited by XTradeX; 09-16-2020, 09:11 AM.

    #2
    Hello, thanks for your post, and welcome to the NinjaTrader forum.

    It looks like you are printing the time stamp of the primary series, or you are running the script OnEachTick on a 15 second bar period. If that is the case, you will only have time stamps for each 15-second interval. So even if the first tick of the bar was at 56:14, it would print as 56:15

    I look forward to assisting.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi Chris,

      I verify the chart and I am on 1 minute chart. I tried with 2 minutes chart and I also get an event each 15 seconds.

      Comment


        #4
        Hello XTradeX, thanks for your reply.

        My test is working fine. I get a print out on the 00 second each time the bar closes. Could you provide a test script?

        Code:
        protected override void OnBarUpdate()
        {
            if(State == State.Realtime)
            {
                if(IsFirstTickOfBar)
                {
                    Print(DateTime.Now);
                }
            }
        }
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,229 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        7 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        441 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        12 views
        0 likes
        Last Post FAQtrader  
        Working...
        X