OPEN-SOURCE SCRIPT

Auto Support/Resistance Zones

437
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.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.