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 burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    14 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    14 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,983 views
    3 likes
    Last Post jhudas88  
    Working...
    X