indicator · on price · open source
VWAP Standard Deviation Bands
Running…
Loading chart…
About
VWAP StDev Bands wrap the live session VWAP with standard-deviation envelopes based on close − VWAP — the institutional 'is the move stretched' gauge.
- A close beyond the upper rail = stretch; mean-reversion is the typical play.
- A close beyond the lower rail = capitulation read; trend continuation setups still appear in strong regimes.
Source code
//@version=5
indicator("VWAP Standard Deviation Bands", overlay=true)
len = input.int(50, "Deviation lookback", minval=5, maxval=500)
mult = input.float(2, "StDev multiplier", minval=0.1, maxval=5, step=0.1)
v = ta.vwap(hlc3)
dev = ta.stdev(close - v, len)
upper = v + dev * mult
lower = v - dev * mult
p_VWAP = plot(v, "VWAP", color=color.orange, linewidth=2)
p_VWAP_Upper = plot(upper, "VWAP Upper", color=color.teal)
p_VWAP_Lower = plot(lower, "VWAP Lower", color=color.teal)
fill(p_VWAP_Upper, p_VWAP_Lower, color=color.new(color.teal, 92))
alertcondition(ta.crossover(close, upper), "Above upper rail", "Price stretched above the VWAP upper band")
alertcondition(ta.crossunder(close, lower), "Below lower rail", "Price stretched below the VWAP lower band")
No comments yet.
Sign in to comment.