OPEN-SOURCE SCRIPT

Support and Resistance

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

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.