Event-Driven Multi-Currency Systems in MetaTrader 5
Summary
This article explains why a multi-currency Expert Advisor or indicator driven only by the current chart’s ticks can miss changes on other symbols, especially in quieter markets. It also discusses the difficulty of aligning bar histories across symbols, detecting updates to another symbol’s history, and keeping incomplete bars synchronized. A timer can decouple processing from chart ticks, but polling every symbol frequently can consume resources and does not resolve the history-alignment issues.
The proposed alternative uses custom chart events: lightweight indicator agents are attached to the symbols being monitored and send tick or initialization notifications to the main program. The receiver can then update only the symbol that generated an event and handle synchronization or history recalculation as needed. Examples include multiple currency symbols and an RSI-based dollar index indicator. The article is an implementation approach rather than a measured comparison; it depends on correctly configuring symbol agents and event handling, and it acknowledges that synchronization methods could be improved.
Key ideas
- A multi-currency system triggered only by the chart symbol’s ticks can become stale when that symbol is quiet.
- Bar counts do not guarantee that histories across symbols align by time.
- Timer polling reduces dependence on chart ticks but can add resource costs and leaves synchronization problems unresolved.
- Custom chart events from per-symbol indicator agents let the main program respond to updates as they occur.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.