Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CurrentBar internal pointers are now updated earlier...

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

    CurrentBar internal pointers are now updated earlier...

    Hi,

    In NinjaScript Code Breaking Changes - Revision 8, December 18, 2009 the following is included:




    CurrentBar internal pointers are now updated earlier. This ensures that accessing bars across multiple series will be in sync regardless of which BarsInProgress context you may be working out of.
    • For historical, pointers for all bar series with the same timestamp will be updated before OnBarUpdate() will be triggered.
    • For real-time, pointers for all bar series of the same instrument will be updated before OnBarUpdate() will be triggered.
    I am trying to understand this point... but having trouble ...

    Can someone provide a few short and illustrative examples of situations that worked one way in NT 6.5, but will now work differently going forward in NinjaScript strategies in NT 7+?

    Many thanks in advance!

    #2
    In NT6.5, in a multi-instrument strategy, Closes[0][0] and Closes[1][0] might refer to different times, even when processing historical data where bars exist for both instruments.

    In NT7, when processing historical data, Closes[0][0] and Closes[1][0] will both refer to the same time (assuming no missing bars).

    In real time, NT7 does not do any synchronization between instruments, which is one reason I built my own synchronization methods (see my Correlation or Ratio indicators for an example).

    In real time, NT7 does synchronize multi-timeframe bars of the same instrument, so if you are in OnBarUpdate for a 5-minute bar where BarsInProgress==0, and BarsInProgress==1 is for 1-minute bars of the same instrument, then Closes[0][0] and Closes[1][0] will refer to the same time. Apparently this was not always the case in NT6.5.

    Comment


      #3
      Very many thanks for the prompt and clear response!

      Originally posted by kdoren View Post
      In real time, NT7 does synchronize multi-timeframe bars of the same instrument, so if you are in OnBarUpdate for a 5-minute bar where BarsInProgress==0, and BarsInProgress==1 is for 1-minute bars of the same instrument, then Closes[0][0] and Closes[1][0] will refer to the same time.
      So, in the above example, immediately after 09H35 EST, Closes[0][0] refers to the OHLCV data between 09H30 - 09H35, while Closes[1][0] refers to the data between 09H34 - 09H35 ... i.e. both refer to the "09H35 bar" for the respective time period.

      (I have to admit that I had thought this was also the situation which had applied for NT 6.5 as well ... can someone from NT clarify where this had not been the case for NT 6.5?)

      Comment


        #4
        Yes, that is correct.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        599 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        344 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        558 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        557 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X