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 trilliantrader, 04-18-2024, 08:16 AM
    4 responses
    16 views
    0 likes
    Last Post trilliantrader  
    Started by mgco4you, Today, 09:46 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by wzgy0920, Today, 09:53 PM
    0 responses
    7 views
    0 likes
    Last Post wzgy0920  
    Started by Rapine Heihei, Today, 08:19 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 08:25 PM
    0 responses
    9 views
    0 likes
    Last Post Rapine Heihei  
    Working...
    X