Building a Chart-Based Market Watch Table with Standard Classes
Summary
This article shows how MetaTrader 5’s standard chart-object classes can be extended to display changing textual information on a chart. It explains the class hierarchy from a general object with list and serialization methods, through chart objects that attach to graphical elements, to text labels and controls. A key distinction is that text objects use price and time coordinates and move with the chart, while labels are positioned in window pixels and stay fixed during scrolling.
The practical example builds a table-style Market Watch indicator that presents instrument details, price changes over selected intervals, and spread information. The symbol set and intervals are configurable, and the display is cleared when the indicator is removed. The article is primarily about MQL5 interface construction rather than a trading strategy or quantitative signal. It provides an implementation pattern for displaying market data and trading-system diagnostics, but it offers no evidence that the display itself improves trading decisions or performance.
Key ideas
- Standard library classes provide reusable foundations for chart objects and text controls.
- Text objects use price-time coordinates, while labels remain fixed to pixel coordinates in a chart window.
- Object attachment stores chart identifiers and names so graphical properties can be accessed through class methods.
- A Market Watch indicator can present instrument data, interval returns, and spreads in a chart-based table.
- The article teaches interface implementation rather than a tested trading strategy.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.