Synchronizing Chart Objects Across Same-Symbol Timeframes in MetaTrader 5
Summary
The article describes an indicator design for keeping graphical objects synchronized across open MetaTrader 5 charts that share a symbol. It compares periodic polling with event-driven updates: polling is simpler but adds delay and repeated work, while chart events let each indicator instance respond to object creation, changes, dragging, or deletion. Because events are local to the chart hosting an instance, the proposed design attaches an instance to each matching chart and forwards changes among them.
The implementation maintains a list of relevant chart IDs, refreshes that list periodically to account for charts opening or closing, and uses chart events and custom messages to copy object state or remove corresponding objects. The article presents this as a way to edit objects on any synchronized chart without repeatedly managing templates. It explains the architecture and implementation choices, but does not provide quantitative latency or load measurements. Its scope is chart annotation synchronization, rather than signal generation or a trading strategy.
Key ideas
- Periodic polling is straightforward but can add update delay and repeated processing overhead.
- Chart events allow object changes to be forwarded promptly without repeatedly checking every object.
- An indicator instance on each matching chart enables changes to originate from any synchronized chart.
- A periodically refreshed chart list can account for charts being opened or closed during operation.
- The method synchronizes visual objects and does not itself generate trading signals.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.