OPEN-SOURCE SCRIPT

Pivot Support & Resistance Zones [NJ]

898
✧ OVERVIEW ✧

Pivot Support & Resistance Zones is a price action indicator that converts confirmed swing highs and swing lows into support and resistance zones.

Each pivot high creates a resistance zone (which can also act as support) and each pivot low creates a support zone (which can also act as resistance). Zone height is based on ATR, so zones scale with market volatility instead of using a fixed price distance.

Zones extend to the right, keeping previous swing levels visible as potential areas of future price reaction.
snapshot

✧ SETTINGS ✧

Color Mode
Switches between colored and neutral visualization.

Color Candles
Shows or hides candle coloring based on candle direction.

Maximum Zones Shown
Controls how many support and resistance zones remain on the chart at the same time.

Swing Strength
Controls how many bars on each side are required to confirm a pivot high or pivot low.

✧ HOW IT WORKS ✧

Pivot Detection
A pivot high forms when a candle's high is the highest value within Swing Strength bars on both sides.
A pivot low forms when a candle's low is the lowest value within Swing Strength bars on both sides.
Higher Swing Strength values detect fewer, more significant swings. Lower values detect more frequent, smaller swings.

Confirmation
A pivot can only be confirmed after Swing Strength bars have closed after it. Each zone therefore appears with a delay equal to Swing Strength, but is drawn starting from the original pivot candle.
Once drawn, a zone does not change position.

Zone Construction
Zone level is placed slightly inside the pivot candle, 10% of its range away from the extreme.
For resistance, this is just below the pivot high. For support, just above the pivot low.
Zone height is based on 14-period ATR measured at the pivot candle.
Upper Edge = Zone Level + ATR × 0.2
Lower Edge = Zone Level − ATR × 0.2

Zone Management
All zones extend to the right until they are removed.
When the number of zones exceeds Maximum Zones Shown, the oldest zone is deleted.
Zones remain on the chart even after price moves through them.

✧ VISUALIZATION ✧

Green zones represent support formed at pivot lows.
Red zones represent resistance formed at pivot highs.

Neutral mode displays the same zones using light and dark shades.

Candles can optionally be colored by direction:
Green represents candles closing above their open.
Red represents candles closing below their open.

✧ USAGE ✧

Pivot Support & Resistance Zones can be used to identify:

Key support and resistance areas
Previous swing highs and swing lows
Potential reaction and reversal zones
Breakout and retest areas
Market structure context
Additional confirmation for other technical analysis

Using zones instead of single lines accounts for the fact that price often reacts within an area around a previous swing rather than at one exact price.

As with any technical indicator, it is best used alongside other forms of analysis rather than as a standalone entry or exit signal.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.