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 Barry Milan, Yesterday, 10:35 PM
        5 responses
        16 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        13 views
        0 likes
        Last Post DanielSanMartin  
        Started by DJ888, 04-16-2024, 06:09 PM
        4 responses
        12 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        11 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by nandhumca, Today, 03:41 PM
        0 responses
        8 views
        0 likes
        Last Post nandhumca  
        Working...
        X