1,501
edits
Line 55: | Line 55: | ||
When a value of a bar '''N''' bars ago is referenced in a script, the study can only be visualized starting with the '''N + 1''' bar. | When a value of a bar '''N''' bars ago is referenced in a script, the study can only be visualized starting with the '''N + 1''' bar. | ||
The number of previous bars that must be available for a script in order to start performing calculations is called '''Maximum number of bars a study will reference''', or '''MaxBarsBack''' | The number of previous bars that must be available for a script in order to start performing calculations is called '''Maximum number of bars a study will reference''', or '''MaxBarsBack'''. | ||
When detected automatically, '''MaxBarsBack '''will initially be set to the value of the largest data offset in the study; however, if a variable data offset is used in the script, the initial '''MaxBarsBack ''' value may prove to be too small. In such a case, the '''MaxBarsBack '''value will automatically be increased by 5 or by a factor of 1.618, whichever yields a higher value, and the study recalculated. | The '''MaxBarsBack''' value can be selected to be detected automatically or set manually. | ||
When detected automatically, '''MaxBarsBack '''will initially be set to the value of the largest data offset in the study; however, if a variable data offset is used in the script, the initial '''MaxBarsBack ''' value may prove to be too small. | |||
In such a case, the '''MaxBarsBack '''value will automatically be increased by 5 or by a factor of 1.618, whichever yields a higher value, and the study recalculated. | |||
The process of automatic '''MaxBarsBack '''detection may cause some functions to be executed repeatedly for the first few bars of a chart when a study is first applied; this can be avoided by setting the '''MaxBarsBack ''' value manually. | The process of automatic '''MaxBarsBack '''detection may cause some functions to be executed repeatedly for the first few bars of a chart when a study is first applied; this can be avoided by setting the '''MaxBarsBack ''' value manually. |