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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X