MaxBarsBack (Reserved Word)

image\trumpet2.gif Disclaimer

All trading strategies, study, and functions that refer to past data will need to wait a certain number of bars before they can start performing calculations. This waiting period value, called Maximum number of bars a study will reference, is set on the General tab of the Properties dialog for a given strategy, study, or function. The MaxBarsBack reserved word returns the value of this setting in your EasyLanguage code. For example, a 10-bar moving average study would require a setting of 10 to begin calculating, which is 9 historical bars and the current bar, so its MaxBarsBack value would return 10.

MaxBarsBack

Remarks

The MaxBarsBack setting may prevent values from being displayed when an indicator is first applied. When enough data sets have been acquired to satisfy the MaxBarsBack setting, values will appear.

When analysis techniques are applied to more than one data set at a time (for example, a multi-data chart), each data set must meet the MaxBarsBack requirement individually before values will be generated.