Skip to content
All library documents

Building a Two-Buffer Aroon Indicator in MQL5

Article MQL5 articles

Summary

This tutorial explains how to adapt a single-buffer custom indicator into a two-buffer Aroon indicator in MQL5. It presents bullish and bearish calculations based on the positions of the highest high and lowest low within a lookback period. The two series are plotted in a separate window, with horizontal reference levels, separate labels, and integer display precision.

The implementation walkthrough covers buffer declarations and binding, indicator properties, input parameters, and the price-array form of OnCalculate needed to access highs and lows. Because the platform lacks the required lookback extreme-index functions in this example, the article shows how to supply them and use them in the calculation loop. It also discusses series indexing and recalculating only the bars needed after the initial pass. The tutorial is focused on indicator construction and code adaptation, not on evaluating Aroon as a trading strategy; it offers no performance evidence for signals derived from the indicator.

Key ideas

  • Aroon bullish and bearish lines can be implemented as two separate indicator buffers.
  • The calculation tracks when the highest high and lowest low occurred within the selected lookback window.
  • In MQL5, the indicator needs high and low price arrays and functions to locate period extremes.
  • Buffer binding, plot labels, display levels, and series indexing are key parts of the implementation.

Tags

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