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

Multiple instruments & event firing order

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

    Multiple instruments & event firing order

    Hi all,
    Correct - all of the Minimum Bars required for each series needs to be satisfied for OnBarUpdate to run your backtest. In the case where historical data is missing for one instrument, you will not see it run until the historical data is available for all.

    #2
    Hello tuanhuy, and thank you for your question.

    all of the Minimum Bars required for each series needs to be satisfied for OnBarUpdate to run your backtest
    This is the responsibility of the programmer to check. The strategy will run even if these are not satisfied. However, trades placed before the bars required to trade have passed will be rejected, disabling the strategy, and referencing BarsAgo indexes before there is data to satisfy them will result in runtime log messages that disable your strategy as well.

    In the case where historical data is missing for one instrument, you will not see it run until the historical data is available for all.
    OnBarUpdate will process for the instruments you do have historical data for. You as a programmer can run a check to see that every member of CurrentBars has at least one bar available if you would like what you said to be true. This check looks like

    Code:
    foreach(int i in CurrentBars)
    {
        if (i < 1)
        {
            return;
        }
    }
    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bmartz, 03-12-2024, 06:12 AM
    4 responses
    31 views
    0 likes
    Last Post bmartz
    by bmartz
     
    Started by Aviram Y, Today, 05:29 AM
    4 responses
    11 views
    0 likes
    Last Post Aviram Y  
    Started by algospoke, 04-17-2024, 06:40 PM
    3 responses
    28 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by gentlebenthebear, Today, 01:30 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by cls71, Today, 04:45 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X