OPEN-SOURCE SCRIPT

ATR based ZigZag

785
An ATR-based ZigZag indicator that adapts automatically to any timeframe without requiring parameter changes. Uses ATR(20) × 2.0 to determine swing significance — swings smaller than this threshold are filtered out as noise, while genuine trend reversals are connected with clean diagonal lines.

Two display modes:
- Classic ZigZag: diagonal lines connecting confirmed swing highs and lows, with a dashed line for the current unconfirmed leg
- Stepped ZigZag: horizontal stepped line tracking the current swing level

Default settings: ATR Lookback 20, Multiplier 2.0.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.