Building Multi-Symbol, Multi-Period Indicators with Library Time Series
Summary
This article explains how to extend an MQL5 library so an indicator can retrieve and display price data for selected symbols and timeframes. It reorganizes shared data definitions, adds arrays for chosen symbols and periods, and describes a separate input-enumeration file that supports English or Russian descriptions at compile time. The example indicator draws candles for one of the configured symbol and timeframe combinations using the library’s time-series data.
The discussion also covers the library design: indicator buffers are represented by structures and stored in arrays, while historical downloads and real-time updates feed the series used by the indicator. The author notes that these structures work but are not especially convenient to manage directly, motivating a planned move to indicator-buffer classes in a later installment. This is an implementation tutorial rather than a trading strategy or performance study. Its example targets MetaTrader 5; the article says its drawing method is unsupported in MetaTrader 4 and that the library version had not been tested there.
Key ideas
- A shared time-series library can support indicators that select among multiple symbols and timeframes.
- The example stores selected symbols and timeframes in arrays accessible to library-based programs.
- Input enumeration descriptions can be compiled in English or Russian using a language-selection macro.
- Indicator buffers are represented as structures, with dedicated classes proposed to simplify their later use.
- The described implementation targets MetaTrader 5 and is not established as compatible with MetaTrader 4.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.