I'm backtesting a multi-series strategy with hundreds of stocks. The stocks have varying lengths of historical data. I found that OnBarUpdate() is not called until data is available for all stocks. For example, if one stock has only 3 months of data, but all other stocks have 10 years of data. The backtest would start from 3 months ago. This is the case even when I set BarsRequired to 0 or -1. This behavior is undesirable, and surprisingly, is inconsistent with the NinjarTrader documentation. The documentation below says: "In a multi-series strategy this restriction applies only for the primary Bars object." Can you please look into this inconsistency? Thank you for your help!
--------------------------------------
Definition of BarsRequired:
The number of historical bars required before the strategy starts processing calls to the OnBarUpdate() method. This property is generally set via the UI when starting a strategy.
The OnBarUpdate() method is not triggered until CurrentBar >= BarsRequired. In a multi-series strategy this restriction applies only for the primary Bars object. Should your strategy logic intertwine calculations across different Bars objects please ensure all Bars objects have met the BarsRequired requirement before proceeding. This can be done via checks on the CurrentBars array.
Property Value
An int value representing the number of historical bars.
Tip:
Comment