OPEN-SOURCE SCRIPT

Volume-Weighted Pivot Bands

215
The Volume-Weighted Pivot Bands are meant to be a dynamic, rolling pivot system designed to provide traders with responsive support and resistance levels that adapt to both price volatility and volume participation. Unlike traditional daily pivot levels, this tool recalculates levels bar-by-bar using a rolling window of volume-weighted averages, making it highly relevant for intraday traders, scalpers, swing traders, and algorithmic systems alike.

-- What This Indicator Does --
This tool calculates a rolling VWAP-based pivot level, and surrounds that central pivot with up to five upper bands (R1–R5) and five lower bands (S1–S5). These act as dynamic zones of potential resistance (R) and support (S), adapting in real time to price and volume changes.

Rather than relying on static session or daily data, this indicator provides continually evolving levels, offering more relevant levels during sideways action, trending periods, and breakout conditions.

-- How the Bands Are Calculated --
Pivot (VWAP Pivot):
The core of this system is a rolling Volume-Weighted Average Price, calculated over a user-defined window (default 20 bars). This ensures that each bar’s price impact is weighted by its volume, giving a more accurate view of fair value during the selected lookback.

Volume-Weighted Range (VW Range):
The highest high and lowest low over the same window are used to calculate the volatility range — this acts as a spread factor.

Support & Resistance Bands (S1–S5, R1–R5):
The bands are offset above and below the pivot using multiples of the VW Range:

R1 = Pivot + (VW Range × multiplier)

R2 = R1 + (VW Range × multiplier)

R3 = R2 + (VW Range x multiplier)

...

S1 = Pivot − (VW Range × multiplier)

S2 = S1 − (VW Range × multiplier)

S3 = S2 - (VW Range x multiplier)

...

You can control the multiplier manually (default is 0.25), to widen or tighten band spacing.

Smoothing (Optional):
To prevent erratic movements, you can optionally toggle on/off a simple moving average to the pivot line (default length = 20), providing a smoother trend base for the bands.

-- How to Use It --
This indicator can be used for:

Support and resistance identification:
Price often reacts to R1/S1, and the outer bands (R4/R5 or S4/S5) act as overshoot zones or strong reversal areas.

Trend context:
If price is respecting upper bands (R2–R3), the trend is likely bullish. If price is pressing into S3 or lower, it may indicate sustained selling pressure or a breakdown.

Volatility framing:
The distance between bands adjusts based on price range over the rolling window. In tighter markets, the bands compress — in volatile moves, they expand. This makes the indicator self-adaptive.

Mean reversion trades:
A move into R4/R5 or S4/S5 without continuation can be a sign of exhaustion — potential for reversal toward the pivot.

Alerting:
Built-in alerts are available for crosses of all major bands (R1–R5, S1–S5), enabling trade automation or scalp alerts with ease.

-- Visual Features --
Fuchsia Lines: Mark all Resistance (R1–R5) levels.

Lime Lines: Mark all Support (S1–S5) levels.

Gray Circle Line: Marks the rolling pivot (VWAP-based).

-- Customizable Settings --
Rolling Length: Number of bars used to calculate VWAP and VW Range.

Multiplier: Controls how wide the bands are spaced.

Smooth Pivot: Toggle on/off to smooth the central pivot.

Pivot Smoothing Length: Controls how many bars to average when smoothing is enabled.

Offset: Visually shift all bands forward/backward in time.

-- Why Use This Over Standard Pivots? --
Traditional pivots are based on previous session data and remain fixed. That’s useful for static setups, but may become irrelevant as price action evolves. In contrast:

This system updates every bar, adjusting to current price behavior.

It includes volume — a key feature missing from most static pivots.

It shows multiple bands, giving a full view of compression, breakout potential, or trend exhaustion.

-- Who Is This For? --
This tool is ideal for:

Day traders & scalpers who need relevant intraday levels.

Swing traders looking for evolving areas of confluence.

Algorithmic/systematic traders who rely on quantifiable, volume-aware support/resistance.

Traders on all assets: works on crypto, stocks, futures, forex — any chart that has volume.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.