TradingView VWAP Deviation Reclaim Indicator: Confirmed Lower-Band Recovery in Pine Script v6

Purpose

This study highlights a confirmed close back above a VWAP deviation lower band following an excursion below it. It is a research indicator, not an automated trading system or a promise of mean reversion.

Exact calculations

VWAP uses the built-in session-anchored volume-weighted hlc3. Calculate the rolling standard deviation of close minus VWAP over 30 bars; the upper and lower bands are VWAP plus/minus 1.5 times that deviation.

TradingView VWAP Deviation Reclaim Indicator: Confirmed Lower-Band Recovery in Pine Script v6
Schematic lower-band reclaim, not historical price data.

Signal rules

Within the prior two completed bars there must have been a close below its contemporaneous lower band. The previous close must be at or below its lower band; the current confirmed close must exceed its current lower band. The signal denotes band recovery, not a VWAP crossover.

Inputs and worked example

Defaults: deviation lookback 30, band multiplier 1.5, prior excursion window 2 bars. If VWAP is 100 and deviation is 2, bands are 97 and 103. With previous close 96.5 and current confirmed close 97.4, the recovery can trigger when the prior excursion condition also holds.

Complete Pine Script v6

//@version=6
indicator("VWAP Deviation Reclaim", overlay = true)
lookback = input.int(30, "Deviation lookback", minval = 5)
mult = input.float(1.5, "Band multiplier", minval = 0.1, step = 0.1)
minBars = input.int(2, "Minimum bars below lower band", minval = 1)
showBands = input.bool(true, "Show bands")
v = ta.vwap(hlc3)
dev = ta.stdev(close - v, lookback)
lower = v - mult * dev
upper = v + mult * dev
// Use previous completed bars to establish an excursion.
wasBelow = ta.lowest(close[1] - lower[1], minBars) < 0
reclaim = close > lower and close[1] <= lower[1]
longSignal = barstate.isconfirmed and not na(v) and not na(dev) and wasBelow and reclaim
plot(v, "VWAP", color = color.teal, linewidth = 2)
plot(showBands ? upper : na, "Upper deviation", color = color.orange)
plot(showBands ? lower : na, "Lower deviation", color = color.orange)
plotshape(longSignal, title = "Confirmed reclaim", style = shape.triangleup, location = location.belowbar, color = color.lime, size = size.small, text = "R")
alertcondition(longSignal, "VWAP deviation reclaim", "Confirmed VWAP lower-band reclaim on {{ticker}} {{interval}}")

Installation

Open TradingView Pine Editor, paste the complete script, save and Add to chart. Use intraday instruments with meaningful volume. Create an alert on VWAP deviation reclaim and select Once Per Bar Close.

Limitations and validation

Session VWAP resets at session boundaries. Early-session rolling deviation may be unavailable; volume quality and extended-hours settings matter. A historical confirmed marker does not guarantee live fill prices. Inspect gaps, session transitions, timeframes, alert behavior and symbol data. This source has not been compiled or backtested in the platform.

Trading risk

Persistent downtrends can produce repeated failed reclaims. Validate out of sample and account for commissions, spreads and slippage. Educational material only; not investment advice.

Interested in this free indicator or trading idea and want to customize, extend, or modify it for your needs? Explore our Custom Trading Software Development Services.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.