Skip to content
All library documents

Refactoring an MQL5 Replay Service to Integrate Its Control Indicator

Article MQL5 articles

Summary

This installment describes changes to an MQL5 market replay and simulation system. Its main goal is to remove the control indicator from the platform's ordinary indicator list and make it part of the replay service. The author begins by removing a chart ID link shared through a terminal global variable, then follows compilation errors to identify code that depends on that link. The article also explains how an embedded indicator executable is included when compiling the service and why the older executable must be removed to trigger recompilation.

The work is a software architecture and development walkthrough rather than a trading strategy. It discusses build coordination and reducing duplicated responsibilities between the service and indicator, but the system remains unstable at the end of this installment. Further changes are deferred, and replay support for orders and positions is still a future goal. The article provides no trading performance evidence.

Key ideas

  • The author aims to integrate the replay control indicator into the MQL5 service instead of exposing it as a normal indicator.
  • The refactor removes a shared chart ID mechanism and uses compilation errors to locate dependent code.
  • The service can embed the indicator executable, but recompiling it may require deleting the existing executable first.
  • The replay system remains unstable after the changes described, and order and position simulation is not yet implemented.

Tags

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