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

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.
    Gaby V.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by lightsun47, Today, 03:51 PM
    0 responses
    5 views
    0 likes
    Last Post lightsun47  
    Started by 00nevest, Today, 02:27 PM
    1 response
    8 views
    0 likes
    Last Post 00nevest  
    Started by futtrader, 04-21-2024, 01:50 AM
    4 responses
    45 views
    0 likes
    Last Post futtrader  
    Started by Option Whisperer, Today, 09:55 AM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by port119, Today, 02:43 PM
    0 responses
    9 views
    0 likes
    Last Post port119
    by port119
     
    Working...
    X