Skip to content
All library documents

ZigZag Moving Average from Reference Points

Article MQL5 code base

Summary

The ZigZag Moving Average (ZMA) uses ZigZag reference points to define where its averaging window begins. From a reference point, it calculates the mean of closing prices from that point through the current bar, so the averaging window expands as bars accumulate after the reference.

The description identifies three configurable ZigZag inputs: depth, deviation, and backstep. It gives a three-bar example showing the average extending one bar at a time from the reference point. It does not provide performance evidence or specify how the indicator handles a reference point that changes as new price data arrives, so the note alone does not establish that the indicator is suitable as a trading signal.

Key ideas

  • ZMA anchors its averaging window to ZigZag reference points.
  • The average includes closing prices from the reference point through the current bar.
  • The averaging window grows as each new bar follows the reference point.
  • Depth, deviation, and backstep are the three ZigZag configuration inputs.

Tags

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