Skip to content
All library documents

Adapting Multi-Symbol Indicator Buffers Between MQL4 and MQL5

Article MQL5 articles

Summary

This installment in the DoEasy library series explains how multi-symbol, multi-period standard indicators can be adapted for MQL4 compatibility. It contrasts MQL5’s separate data, color, and calculated buffers with MQL4’s monochrome buffers, where each displayed color requires its own buffer and the unused color buffers must be hidden. This design affects buffer counts, chart display, and the values shown in the terminal’s data window.

Using the Accumulation/Distribution indicator as an example, the article describes changes to library messages, compatibility constants, and buffer handling, then reports compiling the library in MetaEditor to identify incompatibilities. The aim is incremental cross-platform support so library-based programs can move between platforms. This is a programming and indicator-architecture discussion rather than a trading strategy evaluation; the excerpt is incomplete and does not provide quantitative results or a full account of the final implementation.

Key ideas

  • MQL4 uses separate monochrome buffers for each color of an indicator line, while MQL5 can select a color per bar.
  • The MQL4 buffer approach increases buffer counts as the number of colors or indicator lines grows.
  • MQL4 indicator data requests differ from MQL5’s handle and copied-buffer workflow.
  • The article describes incremental library changes to improve compatibility across the two platforms.
  • The discussion focuses on implementation constraints and compilation, not on trading performance.

Tags

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