Skip to content
All library documents

Building a Chart Trade Indicator for Replay Trading

Article MQL5 articles

Summary

The article describes adapting an existing MetaTrader 5 Chart Trade indicator for a replay simulator. Because the platform’s built-in one-click controls send requests directly to a live server, a simulator needs its own interface. The proposed design has the indicator send custom events for market buys, sells, and closing positions; an Expert Advisor receives those events and performs the trading actions, since indicators cannot manage positions or orders themselves.

The author keeps the implementation in MQL5 and intends the same interface to work first with a demo account and later in the simulator. The tool is scoped to market execution, including increasing or partially closing positions; pending orders are deferred to a separate system. This installment shows event definitions and portions of the indicator’s restructuring, while leaving key behavior to a class covered in the next article. It is therefore an architectural introduction rather than a complete implementation guide, and the author cautions that the code should not be used in isolation.

Key ideas

  • A custom Chart Trade interface is needed because built-in one-click controls communicate directly with a live trading server.
  • The indicator sends custom events, while an Expert Advisor executes position changes.
  • The design covers market entries and position closes, including size increases and partial closes.
  • The MQL5 implementation is intended to support a replay simulator as well as demo-account use.
  • This installment leaves essential implementation details for the following article.

Tags

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