Skip to content
All library documents

Integrating Expert Advisors and Position Indicators with Market Replay

Article MQL5 articles

Summary

This installment describes adapting an MQL5 trading interface to work with a market replay service. A server wrapper routes position queries to either the live trading server or replay data, allowing the Expert Advisor and position indicator to use the same basic logic in both environments. The added ticket lookup supports hedging accounts, where multiple positions can be open at once.

The article walks through how the Expert Advisor responds to chart events and trade transactions, adds or updates position indicators, and removes them when positions or the EA are removed. It also presents the position indicator’s initialization approach and lists the surrounding replay system components. The examples explain integration and simulation plumbing rather than a trading strategy or performance study. The indicator code is incomplete in the supplied text, and the author says some system details remain unfinished, so this installment alone is not a complete implementation guide.

Key ideas

  • A server wrapper lets an application use live or replayed position data through a common interface.
  • Hedging accounts require position-ticket lookup to enumerate multiple open positions.
  • The Expert Advisor manages position indicators in response to chart and trade events.
  • Replay integration is primarily achieved through small changes to the shared server-facing layer.
  • The article presents a partial system and notes that further implementation details remain.

Tags

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