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 giulyko00, Today, 12:03 PM
        0 responses
        1 view
        0 likes
        Last Post giulyko00  
        Started by AttiM, 02-14-2024, 05:20 PM
        12 responses
        213 views
        0 likes
        Last Post DrakeiJosh  
        Started by cre8able, 02-11-2023, 05:43 PM
        3 responses
        238 views
        0 likes
        Last Post rhubear
        by rhubear
         
        Started by frslvr, 04-11-2024, 07:26 AM
        8 responses
        117 views
        1 like
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        10 responses
        47 views
        0 likes
        Last Post stafe
        by stafe
         
        Working...
        X