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.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.