Skip to content
All library documents

Building an Interactive Candle Replay Tool in MQL5

Article MQL5 articles

Summary

The document explains how to build an interactive historical bar replay indicator for MetaTrader 5. It replaces native candles with custom-rendered candles, uses a draggable vertical anchor to choose the replay start, and hides later bars so the trader can review price action without seeing future candles. A timer reveals bars one at a time, while chart events manage playback controls, anchor movement, and chart restoration.

The tool also includes a simple paper-trading feature: Buy and Sell controls draw entry, stop-loss, and take-profit levels, and the position is removed when a newly revealed candle reaches either exit level. The article describes the workflow and implementation components and reports visual checks of anchor movement, trade management, playback controls, and restoration. This is a practice and review aid, not a trading strategy or a substitute for formal backtesting; its simulated trade handling is intentionally limited to one position and does not provide evidence of profitability.

Key ideas

  • Custom candle rendering can hide future bars during discretionary historical review.
  • A draggable anchor sets the starting point for candle-by-candle replay.
  • Timer events reveal bars sequentially, while chart events handle user controls and movement.
  • Buy and Sell controls simulate one paper position with entry, stop-loss, and take-profit lines.
  • Replay can support practice without hindsight, but the tool does not demonstrate a profitable strategy.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.