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 helpwanted, Today, 03:06 AM
        0 responses
        3 views
        0 likes
        Last Post helpwanted  
        Started by Brevo, Today, 01:45 AM
        0 responses
        7 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X