Skip to content
All library documents

ZigZag Average That Switches Between High-Based and Low-Based Means

Article ProRealCode

Summary

This indicator combines ZigZag turning points with a moving average that switches its input according to the latest detected pivot. After a peak is identified, it calculates the average from bar highs; after a trough, it uses bar lows. The ZigZag percentage and average period are configurable, with example defaults included in the document. The plotted line changes color according to whether the average is rising or falling.

The document explains the construction and provides implementation code, but does not propose a complete trading strategy or define entry, exit, or risk rules. It also supplies no chart examples, backtests, or evidence that the alternating average improves on a conventional moving average. Because ZigZag pivots depend on later price movement to confirm turning points, signals based on them may be revised or delayed. The indicator is best understood here as a visual trend aid whose practical value would require separate testing.

Key ideas

  • The indicator uses ZigZag pivots to track whether the latest confirmed turning point is a peak or trough.
  • After a peak, it averages highs; after a trough, it averages lows.
  • The ZigZag percentage and moving-average period are adjustable settings.
  • Line color indicates whether the selected average is rising or falling.
  • The document gives no trading rules or performance evidence, and pivot confirmation may be delayed.

Tags

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