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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    66 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    141 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    46 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    51 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X