Skip to content
All library documents

Building Multi-Line Chart Indicators in MQL5

Article MQL5 articles

Summary

This tutorial explains how to configure one MQL5 custom indicator to draw multiple lines. It starts with a line that follows each bar’s high, then adds a second data buffer for the low. Each plotted line needs its own buffer, a unique buffer index, and matching indicator buffer and plot counts. The article also highlights that plot type and color properties must be declared for each line so MetaTrader reserves and displays them correctly.

Later examples extend the setup to color-aware lines and other drawing styles, including sections, histograms, arrows, zigzags, bars, and candles. The focus is on static indicator construction and the relationship between data buffers and chart plots; it does not explain how to turn the displayed lines into a trading strategy or provide performance evidence. Its examples use raw price values rather than smoothed calculations, and the article leaves more advanced dynamic indicators for future discussion.

Key ideas

  • Each DRAW_LINE plot requires a data buffer containing its values.
  • Assign each buffer a unique index and declare the total number of buffers and plots.
  • Configure plot type and color for every line that should appear on the chart.
  • A single indicator can combine multiple price series, such as bar highs and lows.
  • The same general setup extends to other MQL5 drawing styles.

Tags

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