Accelerating Indicator Tests with Manual and Automatic Tick Emulation
Summary
The document describes a script for testing indicators, expert advisors, and other scripts across historical bars. It uses global variables to pass a bar shift and calculation count to an indicator, and can step through data from a selected starting bar toward the current bar with a configurable delay. A linear regression indicator serves as the example, including use across different chart timeframes.
The workflow supports manual control by repositioning a chart object and automatic control that advances its coordinates. Global flags coordinate calculation readiness and completion; when automatic stepping reaches the current bar, control returns to manual mode. The script also scrolls the chart when the selected range is offscreen and removes its linear regression objects when it ends. This is a testing and visualization aid rather than a trading strategy. The description provides no performance benchmarks, and its account of the setup depends on platform-specific global variables and chart objects.
Key ideas
- Global variables let a script set an indicator's bar shift and calculation count.
- Automatic mode advances through bars with a configurable delay, while manual mode lets the user set the range.
- A readiness flag coordinates each indicator calculation with the script.
- The example uses linear regression and demonstrates control across chart timeframes.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.