Detecting Timeframe Changes in a Replay Simulator Through Indicator Data
Summary
This installment addresses a usability failure in a MetaTrader replay and market simulator: changing the chart timeframe reloads its indicators, leaving the mouse display in the wrong state and removing the controls. Recovery may depend on a later custom event from the service, and can require restarting playback or the service when playback is paused.
The article considers preserving indicator state in a file or terminal variable, but explains that saved values can become stale and may initialize indicators incorrectly on ordinary live charts. It also considers having the replay service inspect the chart timeframe directly, which the author says it cannot do. The proposed experiment combines these ideas by placing timeframe information in an indicator data buffer for the service to monitor. A detected change could then trigger the existing indicator update mechanism.
This is a design and testing installment rather than a finished implementation: the complete service and indicator changes are deferred to a later article. Its focus is the coordination of chart state and custom events in a replay tool, not a trading method or measured performance result.
Key ideas
- Changing chart timeframe reloads indicators and can leave replay controls unavailable or display stale market status.
- Persisting indicator state in files or terminal variables risks stale values and incorrect initialization on live charts.
- The proposed design writes timeframe information to an indicator buffer so the replay service can detect chart changes.
- A detected timeframe change would prompt the service to update the control and mouse indicators through custom events.
- This installment outlines and tests the approach but defers the full implementation to a later article.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.