Skip to content
All library documents

Donchian-Style Channel Pivots and Dynamic Zigzag Trendlines

Article MQL5 code base

Summary

This indicator develops a zigzag view from a Donchian-style channel. It identifies pivots when the channel becomes flat, then uses a depth setting to confirm that flatness before marking a pivot and connecting it to the next zigzag leg. The pivot logic does not apply forward corrections, but confirmation introduces lag.

For the active leg, a dynamic trendline runs from the most recently confirmed pivot to the current price extreme and updates until another pivot is confirmed. The intended use is qualitative observation of whether price reacts to a trendline with a bounce or changes direction in a way that alters the line. The description explicitly treats the tool as a visual aid rather than a precise forecasting or standalone decision method. It provides no tested markets, parameter guidance, or performance evidence. A later version also offers a choice between trendline generation and a classic repainting zigzag mode.

Key ideas

  • The indicator derives zigzag pivots from periods when a Donchian-style channel flattens.
  • A depth setting confirms channel flatness before a pivot is marked, which adds lag.
  • The current leg is drawn dynamically from the latest confirmed pivot to the current price extreme.
  • The trendlines are intended to help interpret reactions and direction changes, not forecast exact moves.
  • The description provides no empirical performance evidence and cautions against using the tool alone.

Tags

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