OPEN-SOURCE SCRIPT

PivotBoss VWAP Bands (Auto TF) - Fixed

65
What this indicator shows (high level)

The indicator plots a VWAP line and three bands above (R1, R2, R3) and three bands below (S1, S2, S3).
Band spacing is computed from STD(abs(VWAP − price), N) and multiplied by 1, 2 and 3 to form R1–R3 / S1–S3. The script is timeframe-aware: on 30m/1H charts it uses Weekly VWAP and weekly bands; on Daily charts it uses Monthly VWAP and monthly bands; otherwise it uses the session/chart VWAP.

VWAP = the market’s volume-weighted average price (a measure of fair value). Bands = volatility-scaled zones around that fair value.

Trading idea — concept summary

VWAP = fair value. Price above VWAP implies bullish bias; below VWAP implies bearish bias.

Bands = graded overbought/oversold zones. R1/S1 are near-term limits, R2/S2 are stronger, R3/S3 are extreme.

Use trend alignment + price action + volume to choose higher-probability trades. VWAP bands give location and magnitude; confirmations reduce false signals.

Entry rules (multiple strategies with examples)
A. Momentum breakout (trend-following) — preferred on trending markets

Setup: Price consolidates near or below R1 and then closes above R1 with above-average volume. Chart: 30m/1H (Weekly VWAP) or Daily (Monthly VWAP) depending on your timeframe.

Entry: Enter long at the close of the breakout bar that closes above R1.

Stop-loss: Place initial stop below the higher of (VWAP or recent swing low). Example: if price broke R1 at ₹1,200 and VWAP = ₹1,150, set stop at ₹1,145 (5 rupee buffer below VWAP) or below the last swing low if that is wider.

Target: Partial target at R2, full target at R3. Trail stop to VWAP or to R1 after price reaches R2.

Example numeric: Weekly VWAP = ₹1,150, R1 = ₹1,200, R2 = ₹1,260. Buy at ₹1,205 (close above R1), stop ₹1,145, target1 ₹1,260 (R2), target2 ₹1,320 (R3).

B. Mean-reversion fade near bands — for range-bound markets

Setup: Market is not trending (VWAP flatish). Price rallies up to R2 or R3 and shows rejection (pin bar, bearish engulfing) on increasing or neutral volume.

Entry: Enter short after a confirmed rejection candle that fails to sustain above R2 or R3 (prefer confirmation: close back below R1 or below the rejection candle low).

Stop-loss: Just above the recent high (e.g., 1–2 ATR or a fixed buffer above R2/R3).

Target: First target VWAP, second target S1. Reduce size if taking R3 fade as it’s an extreme.

Example numeric: VWAP = ₹950, R2 = ₹1,020. Price spikes to ₹1,025 and forms a bearish engulfing candle. Enter short at ₹1,015 after the next close below ₹1,020. Stop at ₹1,035, target VWAP ₹950.

C. Pullback entries in trending markets — higher probability

Setup: Price is above VWAP and trending higher (higher highs and higher lows). Price pulls back toward VWAP or S1 with decreasing downside volume and a reversal candle forms.

Entry: Long when price forms a bullish reversal (hammer/inside-bar) with a close back above the pullback candle.

Stop-loss: Below the pullback low (or below S2 if a larger stop is justified).

Target: VWAP then R1; if momentum resumes, trail toward R2/R3.

Example numeric: Price trending above Weekly VWAP at ₹1,400; pullback to S1 at ₹1,360. Enter long at ₹1,370 when a bullish candle closes; stop at ₹1,350; first target VWAP ₹1,400, second target R1 ₹1,450.

Exit rules and money management
Basic exit hierarchy

Hard stop exit — when price hits initial stop-loss. Always use.

Target exit — take partial profits at R1/R2 (for longs) or S1/S2 (for shorts). Use trailing stops for the remainder.

VWAP invalidation — if you entered long above VWAP and price returns and closes significantly below VWAP, consider exiting (condition depends on timeframe and trade size).

Price action exit — reversal patterns (strong opposite candle, bearish/bullish engulfing) near targets or beyond signals to exit.

Trailing rules

After price reaches R2, move stop to breakeven + a small buffer or to VWAP.

After price reaches R3, trail by 1 ATR or lock a defined profit percentage.

Position sizing & risk

Risk per trade: commonly 0.5–2% of account equity.

Determine position size by RiskAmount ÷ (EntryPrice − StopPrice).

If the stop distance is large (e.g., trading R3 fades), reduce position size.

Filters & confirmation (to reduce false signals)

Volume filter: For breakouts, require volume above short-term average (e.g., >20-period average). Breakouts on low volume are suspect.

Trend filter: Only take breakouts in the direction of the higher-timeframe trend (for example, use Daily/Weekly trend when trading 30m/1H).

Candle confirmation: Prefer entries on close of the confirming candle (not intrabar noise).

Multiple confirmations: When R1 break happens but RSI/plotted momentum indicator does not confirm, treat signal as lower probability.

Special considerations for timeframe-aware logic

On 30m/1H the script uses Weekly VWAP/bands. That means band levels change only on weekly candles — they are strong, structural levels. Treat R1/R2/R3 as significant and expect fewer, stronger signals.

On Daily, the script uses Monthly VWAP/bands. These are wider; trades should allow larger stops and smaller position sizes (or be used for swing trades).

On other intraday charts you get session VWAP (useful for intraday scalps).

Example: If you trade 1H and the Weekly R1 is at ₹2,400 while session VWAP is ₹2,350, a close above Weekly R1 represents a weekly-level breakout — prefer that for swing entries rather than scalps.

Example trade walkthrough (step-by-step)

Context: 1H chart, auto-mapped → Weekly VWAP used.

Weekly VWAP = ₹3,000; R1 = ₹3,080; R2 = ₹3,150.

Price consolidates below R1. A large bullish candle closes at ₹3,085 with volume 40% above the 20-bar average.

Entry: Buy at close ₹3,085.

Stop: Place stop at ₹2,995 (just under Weekly VWAP). Risk = ₹90.

Position size: If risking ₹900 per trade → size = 900 ÷ 90 = 10 units.

Targets: Partial take-profit at R2 = ₹3,150; rest trailed with stop moved to breakeven after R2 is hit.

If price reverses and closes below VWAP within two bars, exit immediately to limit drawdown.

When to avoid trading these signals

High-impact news (earnings, macro announcements) that can gap through bands unpredictably.

Thin markets with low volume — VWAP loses significance when volumes are extremely low.

When weekly/monthly bands are flat but intraday price is volatile without clear structure — prefer session VWAP on smaller timeframes.

Alerts & automation suggestions

Alert on close above R1 / below S1 (use the built-in alertcondition the script adds). For higher-confidence alerts, require volume filter in the alert condition.

Automated order rules (if you automate): use limit entry at breakout close plus a small slippage buffer, immediate stop order, and OCO for TP and SL.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.