OPEN-SOURCE SCRIPT
Support and Resistance

Support & Resistance Zones
This indicator automatically identifies support and resistance zones by clustering confirmed pivot highs and lows into statistically valid price areas.
Instead of drawing single horizontal lines, it creates price zones whose width is dynamically controlled using ATR (Average True Range), allowing the zones to adapt to market volatility.
Core Logic
The indicator scans a user-defined number of historical bars and detects pivot highs and pivot lows using a configurable pivot strength.
Each new pivot is evaluated against previously detected zones:
A zone becomes visible only after receiving sufficient confirmation (minimum number of pivot touches).
This ensures that only structurally meaningful levels are drawn.
Zone Construction Rules
Zones are formed by grouping pivot points whose total price range remains within ATR range
Each zone expands dynamically as new pivots confirm it
Zones are drawn as rectangular areas, not lines
Zones extend to the right, remaining active until price structure changes
This approach avoids over-plotting and reduces noise commonly seen in traditional support/resistance tools.
Dynamic Zone Coloring
Zones automatically change color based on current price position:
Support Color → Price is above the zone
Resistance Color → Price is below the zone
Neutral (In-Zone) Color → Price is trading inside the zone
This makes it easy to visually assess market context without additional indicators.
Inputs Explained
Logic Settings
Bars to Apply
Number of historical bars scanned to detect pivots and construct zones.
Pivot Strength
Number of candles required on both sides of a pivot high/low for confirmation.
Min Pivot Confirmation
Minimum number of aligned pivots required before a zone is drawn.
Styling
Support, resistance, and in-zone colors
Zone fill transparency
Why This Approach
Uses price structure, not arbitrary levels
Adapts to market volatility via ATR
Filters out weak, single-touch levels
Works across all markets and timeframes
This indicator is designed to highlight areas of interest, not generate buy or sell signals.
It is best used in combination with trend, momentum, or volume-based tools.
This indicator automatically identifies support and resistance zones by clustering confirmed pivot highs and lows into statistically valid price areas.
Instead of drawing single horizontal lines, it creates price zones whose width is dynamically controlled using ATR (Average True Range), allowing the zones to adapt to market volatility.
Core Logic
The indicator scans a user-defined number of historical bars and detects pivot highs and pivot lows using a configurable pivot strength.
Each new pivot is evaluated against previously detected zones:
A zone becomes visible only after receiving sufficient confirmation (minimum number of pivot touches).
This ensures that only structurally meaningful levels are drawn.
Zone Construction Rules
Zones are formed by grouping pivot points whose total price range remains within ATR range
Each zone expands dynamically as new pivots confirm it
Zones are drawn as rectangular areas, not lines
Zones extend to the right, remaining active until price structure changes
This approach avoids over-plotting and reduces noise commonly seen in traditional support/resistance tools.
Dynamic Zone Coloring
Zones automatically change color based on current price position:
Support Color → Price is above the zone
Resistance Color → Price is below the zone
Neutral (In-Zone) Color → Price is trading inside the zone
This makes it easy to visually assess market context without additional indicators.
Inputs Explained
Logic Settings
Bars to Apply
Number of historical bars scanned to detect pivots and construct zones.
Pivot Strength
Number of candles required on both sides of a pivot high/low for confirmation.
Min Pivot Confirmation
Minimum number of aligned pivots required before a zone is drawn.
Styling
Support, resistance, and in-zone colors
Zone fill transparency
Why This Approach
Uses price structure, not arbitrary levels
Adapts to market volatility via ATR
Filters out weak, single-touch levels
Works across all markets and timeframes
This indicator is designed to highlight areas of interest, not generate buy or sell signals.
It is best used in combination with trend, momentum, or volume-based tools.
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.