OPEN-SOURCE SCRIPT
Updated

Average Zigzag Range (AZR)

6 396
Here is an attempt calculate Average Zigzag Range (AZR). This can be used similar to ATR. Using AZR instead of ATR for trailing stop calculation may yield better outcome in trend trading.

Logic is simple.
  • Calculate zigzag based on ZigzagLength
  • Calculate distance between each zigzag pivots
  • Calculate simple moving average of last MALength pivots
  • Use DoubleMA option to further smooth AZR using a Secondary Moving Average
Release Notes
Added option to print separate AZR for Zigzag Highs and Lows

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.