OPEN-SOURCE SCRIPT
Simplified Pivot Zone & ZigZag Indicator

Simplified Pivot Zone & ZigZag Indicator (中樞簡易版 by OldGrumpyCat)
This indicator is a streamlined technical analysis tool that combines a dynamic adaptive pivot zone with an integrated ZigZag swing structure overlay. It is designed to help traders identify key areas of price equilibrium, significant swing highs and lows, and potential trend reversals — all within a single, lightweight script.
The pivot zone is constructed by computing a cumulative average deviation of price from a dynamically adjusted baseline. This produces an upper and lower band that forms a shaded central zone, visually highlighting regions where price has historically found support or resistance. The width of this zone scales with the user-defined Size parameter, making it adaptable to different instruments and timeframes.
The ZigZag component automatically connects significant swing highs and lows based on a configurable lookback depth (Depth) and deviation threshold. This makes it straightforward to read market structure, identify the prevailing trend direction, and map out wave sequences for further analysis. A Repaint toggle is provided: when enabled, the ZigZag updates dynamically on the current bar for real-time feedback; when disabled, lines are only drawn upon confirmed bar closes, eliminating repainting artifacts.
All visual elements — including the pivot zone fill color, line segment color, zone width, and line thickness — are fully customizable through the indicator's input panel, ensuring seamless integration with any chart theme or trading workflow.
This indicator is a streamlined technical analysis tool that combines a dynamic adaptive pivot zone with an integrated ZigZag swing structure overlay. It is designed to help traders identify key areas of price equilibrium, significant swing highs and lows, and potential trend reversals — all within a single, lightweight script.
The pivot zone is constructed by computing a cumulative average deviation of price from a dynamically adjusted baseline. This produces an upper and lower band that forms a shaded central zone, visually highlighting regions where price has historically found support or resistance. The width of this zone scales with the user-defined Size parameter, making it adaptable to different instruments and timeframes.
The ZigZag component automatically connects significant swing highs and lows based on a configurable lookback depth (Depth) and deviation threshold. This makes it straightforward to read market structure, identify the prevailing trend direction, and map out wave sequences for further analysis. A Repaint toggle is provided: when enabled, the ZigZag updates dynamically on the current bar for real-time feedback; when disabled, lines are only drawn upon confirmed bar closes, eliminating repainting artifacts.
All visual elements — including the pivot zone fill color, line segment color, zone width, and line thickness — are fully customizable through the indicator's input panel, ensuring seamless integration with any chart theme or trading workflow.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.