Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multi series data index is off

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

    multi series data index is off

    Hi,

    My primary data is ES 5minute . It's calculated on each tick. My secondary data is SPY 5minute.

    if(IsFirstTickOfBar)
    Log( Times[0][1] + " " + Times[1][0] + " " + Times[1][1] , LogLevel.Information);

    And here is what I got in the log.
    1/17/2024 20:35:24 NinjaScript 1/17/2024 13:05:00 1/17/2024 13:05:00 1/17/2024 13:00:00
    And another example
    1/17/2024 20:34:31 NinjaScript 1/17/2024 10:40:00 1/17/2024 10:45:00 1/17/2024 10:40:00
    First example prints out the wrong time for its index. The second prints correctly. How is this even possible? This is done using historical playback​​​

    #2
    Hello affilife,

    Thank you for your post.

    Not all Bars objects are being updated in the script at once on each pass of OnBarUpdate(). In a multi-bars script, the OnBarUpdate() method is called for each Bars object of a script.

    BarsInProgress can be used to check which Bars object is currently calling OnBarUpdate().

    BarsInProgress - https://ninjatrader.com/support/help...inprogress.htm

    Please note it's also possible that the other series did not have a bar update.

    If you have any further questions, please let us know.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X