While searching through various threads on memory usage, I came across MaximumBarsLookBack and I don't understand how it's used.
When I create a new strategy, MaximumBarsLookBack is set to TwoHundredFiftySix and Days To Load is set to 20 in the Edit Strategy window. My code does not specify a value for MaximumBarsLookBack, so presumably it's using the value set in the UI, or 256.
I have a loop in the code that iterates through the most recent 3000 1-minute bars and does some calculations. These calculations are only done once, and then I set a flag to keep the loop from running again.
If MaximumBarsLookBack is set to 256, then how can it be looking at 3000 bars of historical data? I'm almost positive that it's really looking back 3000 bars.
After reading a little about MaximumBarsLookBack, it seems that I could set MaximumBarsLookBack to Infinite when the program is initiated, then after my one-time loop set it down to 256. In fact, I could set it as low as 61 if that would further improve performance.
So, my questions are:
1. If MaximumBarsLookBack is set to TwoHundredFiftySix on the Edit Strategy screen and not defined in the code, but the code loops back to view 3000 bars of data, then is MaximumBarsLookBack being overridden, or is it not used in this situation?
2. Would it help performance to set MaximumBarsLookBack to Infinite in the code and then set it to TwoHundredFiftySix after the one-time loop?
3. Can I set the MaximumBarsLookBack to another number less than 256?
Comment