OPEN-SOURCE SCRIPT

Enhanced Zigzag [victhoreb] (V2)

202
** This is the updated version of my pre-existing Zigzag indicator **

Enhanced Zigzag is an optimized version of the classic zigzag indicator, crafted using 50 lines of Pine Script code compared to TradingView’s native version which exceeds 300 lines. Its compact logic efficiently detects pivot highs and lows using customizable lookback periods, then dynamically connects these key points with clear, color-adjustable zigzag lines. With options to toggle the zigzag display and enable repainting, this indicator offers both performance and flexibility—providing traders with a streamlined tool for identifying market swings and potential reversals with minimal code complexity.

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.