Skip to content
All library documents

Refactoring an MQL5 Market Replay System into Connected Classes

Article MQL5 articles

Summary

This installment refactors an MQL5 market replay and simulation service by splitting a large replay class into smaller connected classes. It describes a file-reading class, private inheritance for implementation details, and a replay class that exposes a limited interface. The service creates and destroys the replay object explicitly with a pointer, then checks whether initialization succeeded before running the replay loop. The aim is to make the system easier to maintain and extend while preserving its prior user-facing behavior.

The article is an architectural programming discussion rather than an explanation of a trading strategy or evidence about market simulation quality. It relates the class structure to reading market bars and running replay events, but gives no quantitative comparison of memory use, reliability, or simulation accuracy. Its claims about pointers and safety are presented as the author’s implementation rationale; readers still need to understand object lifetime and initialization checks when adapting the design.

Key ideas

  • The replay service is reorganized into smaller classes to separate file handling and replay responsibilities.
  • Private inheritance hides implementation details from the externally accessible replay interface.
  • The service explicitly creates and deletes its replay object through a pointer.
  • A replay initialization check determines whether the service should enter its event loop.
  • The article documents software architecture changes but provides no measured evidence about simulation accuracy or performance.

Tags

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