OPEN-SOURCE SCRIPT
Auto Support/Resistance Zones

Auto Support Resistance Zones is a visual support and resistance mapping tool built from confirmed pivot highs and pivot lows.
The script automatically detects confirmed swing pivots, clusters nearby pivot prices into horizontal zones, and displays the most relevant zones around current price. Instead of drawing single-price support or resistance lines, it builds price areas because real market reactions often occur around ranges rather than exact levels.
What the script shows
- Horizontal support and resistance zones
- Zones built from confirmed pivot highs and pivot lows
- Touch count for each zone
- Zone role: S, R, or Inside
- Relative strength label: Valid, Good, or Strong
- Pivot source label: H, L, or H/L
- Zone price range
- A compact state label showing the nearest support and resistance context
- Optional alerts for zone entry, zone exit, support break, and resistance break
How it works
The script uses confirmed pivot highs and confirmed pivot lows. A pivot is only available after the selected Pivot strength bars have passed.
Nearby pivot prices are grouped into zones using an ATR-based clustering method. If multiple pivots occur close to the same price area, they are merged into one zone. The script then evaluates each zone using touch count, recency, and zone width.
The displayed zones can be selected using:
- Nearest to price
- Most touches
- Balanced strength
Balanced strength is designed to keep the chart cleaner by considering both the number of touches and the freshness of the zone.
Zone labels
Each zone label can show:
- S: price is above the zone, so the zone is currently acting as support
- R: price is below the zone, so the zone is currently acting as resistance
- Inside: price is currently trading inside the zone
- x count: number of confirmed pivot touches
- H: zone mainly built from pivot highs
- L: zone mainly built from pivot lows
- H/L: mixed pivot-high and pivot-low area
- Valid / Good / Strong: a relative descriptive strength label
The strength label is not a prediction. It is only a descriptive score based on the zone’s structure.
State label
The state label summarizes the current relationship between price and nearby zones. It can show whether price is inside a zone or between zones, and it displays the nearest resistance and support areas when available.
Main inputs
Pivot Detection:
- Pivot strength
- Lookback bars
Zone Building:
- Cluster width x ATR
- Zone padding x ATR
- Maximum zone height x ATR
- Minimum touches
- Minimum bars between touches
- Maximum zones shown
- Zone selection mode
Display:
- Zone starts from first touch or last touch
- Show zone labels
- Show S/R role
- Show touch counts
- Show strength
- Show pivot source H/L
- Show price ranges
- Show state label
- State label offset
- Right-side zone extension
- Label size
Style:
- Zone border width
- Zone fill transparency
- Zone border transparency
- Support color
- Resistance color
- Inside-zone color
- State label text color
Alerts
The script includes alert conditions for:
- Zone entered
- Zone exited
- Resistance broken
- Support broken
These alerts are descriptive chart events. They are not buy or sell signals.
Repainting and confirmation note
This script uses confirmed pivot highs and confirmed pivot lows. Because pivots require confirmation, a new pivot appears only after the selected Pivot strength bars have passed.
When new pivots are confirmed, zones can be rebuilt, merged, or reclassified as support, resistance, or inside-zone areas depending on current price. This is normal behavior for a confirmed-pivot support and resistance tool.
The script does not use future-looking signals to predict price movement. It displays zones derived from confirmed historical pivot structure.
Limitations
Support and resistance zones are visual reference areas, not guaranteed reaction levels.
A zone with more touches or a stronger label does not guarantee that price will reverse, hold, reject, or break from that zone.
The script is intended for chart analysis, education, and visual review of horizontal price structure. It is not a trading system, financial advice, or a standalone buy/sell tool.
The script automatically detects confirmed swing pivots, clusters nearby pivot prices into horizontal zones, and displays the most relevant zones around current price. Instead of drawing single-price support or resistance lines, it builds price areas because real market reactions often occur around ranges rather than exact levels.
What the script shows
- Horizontal support and resistance zones
- Zones built from confirmed pivot highs and pivot lows
- Touch count for each zone
- Zone role: S, R, or Inside
- Relative strength label: Valid, Good, or Strong
- Pivot source label: H, L, or H/L
- Zone price range
- A compact state label showing the nearest support and resistance context
- Optional alerts for zone entry, zone exit, support break, and resistance break
How it works
The script uses confirmed pivot highs and confirmed pivot lows. A pivot is only available after the selected Pivot strength bars have passed.
Nearby pivot prices are grouped into zones using an ATR-based clustering method. If multiple pivots occur close to the same price area, they are merged into one zone. The script then evaluates each zone using touch count, recency, and zone width.
The displayed zones can be selected using:
- Nearest to price
- Most touches
- Balanced strength
Balanced strength is designed to keep the chart cleaner by considering both the number of touches and the freshness of the zone.
Zone labels
Each zone label can show:
- S: price is above the zone, so the zone is currently acting as support
- R: price is below the zone, so the zone is currently acting as resistance
- Inside: price is currently trading inside the zone
- x count: number of confirmed pivot touches
- H: zone mainly built from pivot highs
- L: zone mainly built from pivot lows
- H/L: mixed pivot-high and pivot-low area
- Valid / Good / Strong: a relative descriptive strength label
The strength label is not a prediction. It is only a descriptive score based on the zone’s structure.
State label
The state label summarizes the current relationship between price and nearby zones. It can show whether price is inside a zone or between zones, and it displays the nearest resistance and support areas when available.
Main inputs
Pivot Detection:
- Pivot strength
- Lookback bars
Zone Building:
- Cluster width x ATR
- Zone padding x ATR
- Maximum zone height x ATR
- Minimum touches
- Minimum bars between touches
- Maximum zones shown
- Zone selection mode
Display:
- Zone starts from first touch or last touch
- Show zone labels
- Show S/R role
- Show touch counts
- Show strength
- Show pivot source H/L
- Show price ranges
- Show state label
- State label offset
- Right-side zone extension
- Label size
Style:
- Zone border width
- Zone fill transparency
- Zone border transparency
- Support color
- Resistance color
- Inside-zone color
- State label text color
Alerts
The script includes alert conditions for:
- Zone entered
- Zone exited
- Resistance broken
- Support broken
These alerts are descriptive chart events. They are not buy or sell signals.
Repainting and confirmation note
This script uses confirmed pivot highs and confirmed pivot lows. Because pivots require confirmation, a new pivot appears only after the selected Pivot strength bars have passed.
When new pivots are confirmed, zones can be rebuilt, merged, or reclassified as support, resistance, or inside-zone areas depending on current price. This is normal behavior for a confirmed-pivot support and resistance tool.
The script does not use future-looking signals to predict price movement. It displays zones derived from confirmed historical pivot structure.
Limitations
Support and resistance zones are visual reference areas, not guaranteed reaction levels.
A zone with more touches or a stronger label does not guarantee that price will reverse, hold, reject, or break from that zone.
The script is intended for chart analysis, education, and visual review of horizontal price structure. It is not a trading system, financial advice, or a standalone buy/sell tool.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。