Does the BarsPeriodType or the period values of those types drastically affect the system resources or optimization of a strategy?
For instance using the following examples:
Using AddDataSeries(string instrumentName, BarsPeriod barsPeriod, string tradingHoursName)
1.) AddDataSeries("ES 03-21", new BarsPeriod { BarsPeriodType = BarsPeriodType.Second, Value = 60 }, "CME US Index Futures RTH"); // 60 second bars
2.) AddDataSeries("ES 03-21", new BarsPeriod { BarsPeriodType = BarsPeriodType.Second, Value = 1 }, "CME US Index Futures RTH"); // 1 second bars
3.) AddDataSeries("ES 03-21", new BarsPeriod { BarsPeriodType = BarsPeriodType.Minute, Value = 1 }, "CME US Index Futures RTH"); // 1 minute bars
4.) AddDataSeries("ES 03-21", new BarsPeriod { BarsPeriodType = BarsPeriodType.Minute, Value = 450 }, "930am-500pm"); // 450 minute bars with a custom intraday trading hours template
or using the simpler
5.) AddDataSeries("ES 03-21", Data.BarsPeriodType.Second, 1); // 1 second bars
Would any of these create a substantial difference in allocated system resources when they load or when data from them is called?
With all the values from added data series being indexed by NT while a strategy is running, having the fewest stored values seems ideal. So if I only need the opening value of bar that opens at 9:30 am, and this value is only called once during during the life of the strategy during the first iteration of OnBarUpdate at 9:30:01 am, creating a bar that will only add one value to that index for the life of the strategy seems to be the best solution. Opposed to using a 1 minute or 1 second bar and period type that would store many values while a strategy is running for many hours.
Or does this not really impact the performance of a strategy very much?
And when might the overload with barsToLoad be used? Is this primarily for adding data series in indicators?
Or will loading bars here satisfy the value of BarsRequiredToTrade value by loading historical bars?
Thank you for any information
Comment