Skip to content
All library documents

Integrating Order Book Events into a Market Replay Service

Article MQL5 articles

Summary

This article describes adapting a MetaTrader replay and simulation service to use custom order book events. It changes the startup sequence for control and mouse indicators, sets the custom replay symbol’s book depth, and explains how the mouse indicator subscribes to book updates. These steps allow the indicator to receive the events needed for its calculations and status display.

The article also discusses the indicator’s initial market status and how replay state affects whether it should show an auction message or bar time remaining. A hidden control indicator can leave the service sending ticks without a way to pause it, creating a problem when the chart timeframe changes. The author leaves detecting timeframe changes as an open problem for readers and promises a solution in a later installment. This is software implementation guidance for replay tooling, not a trading strategy; it provides code-level design choices but no performance evidence.

Key ideas

  • The replay symbol must be configured to support order book events before the indicator can receive them.
  • The service loads its control indicator before waiting for the mouse indicator to appear.
  • The mouse indicator’s status should reflect replay state rather than assume a live market is closed.
  • A missing control indicator can prevent pausing and complicate recovery when the chart timeframe changes.

Tags

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