The “Maximum Bars Look Back” drop-down list in a Quagensia N Edition Strategy’s “Strategy Details” section defaults to “Infinity” instead of “256” to protect users from hard-to-debug problems.
The value of the “Maximum Bars Look Back” drop-down list field in a Quagensia N Edition Strategy’s “Strategy Details” section determines the default memory performance of custom data series, which are called “Editable Time Series” in Quagensia N Edition, and also can be a potential source of hard-to-debug problems if the “256 (Reduces Memory Consumption But Can Cause Hard-To-Debug Problems)” option of this drop-down list is selected for a strategy.
When using “256 (Reduces Memory Consumption But Can Cause Hard-To-Debug Problems)”, only the last 256 values of an Editable Time Series will be stored in memory and be able to be referenced. This reduces memory consumption when using Editable Time Series.
Strategies that need access to older values can use “Infinite” to allow full access to all the data points of a Quagensia N Edition Strategy’s Editable Time Series.
Note that data series that hold bar data (such as price bars, with open, high, low, and close values) as well as data series that hold indicator plot values always use “Infinite” regardless of your choice for the MaximumBarsLookBack property of your strategy, as stated in the MaximumBarsLookBack help page of the official NinjaTrader® help documentation. Since many other data series in a NinjaScript® strategy already use “Infinite” regardless of your choice for the value of the “Maximum Bars Look Back” drop-down list field in a Quagensia N Edition Strategy’s “Strategy Details” section, and since we at Quagensia are aware of two potentially hard-to-debug problems that Quagensia N Edition users may encounter if they set this drop-down list’s value to “256 (Reduces Memory Consumption But Can Cause Hard-To-Debug Problems)”, the default value of this drop-down list is “Infinity”, and the name of the “256” choice in this drop-down list is “256 (Reduces Memory Consumption But Can Cause Hard-To-Debug Problems)” to give users a heads up that the “256” option is not trouble-free.
We at Quagensia are aware of the following two potentially hard-to-debug problems that Quagensia N Edition users may encounter if they set this drop-down list’s value to “256 (Reduces Memory Consumption But Can Cause Hard-To-Debug Problems)”:
- Plotting an indicator that uses an Editable Time Series as its input (such as is done in the technique of plotting a 1-period Simple Moving Average (SMA) of an Editable Time Series rather than plotting the Editable Time Series itself so that the Editable Time Series can be plotted on a chart panel other than the default plot panel) may plot the most recent 256 values correctly but then copy the plot of those most recent 256 values onto the 256 values plotted prior to the most recent 256 values and repeat this pattern of the most recent 256 values being plotted in 256-bar blocks going back to even older bars, with the net effect being a 256-point repeating pattern, not the actual plot on the bars older than the most recent 256 bars.
- Attempting to access a data point of an Editable Time Series older than the most recent 256 points may cause an error to occur. If an Editable Time Series is plotted directly, this error may not occur, but if an Editable Time Series is either not plotted or if its “plot” is actually a plot of a 1-period Simple Moving Average (SMA) indicator that is meant to represent what the plot of the Editable Time Series would look like, then this error is likely to occur.