1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
96 lines of Pine Script v4 from dwm_vwap_bands.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.
dwm_vwap_bands.pine
// Daily, Weekly and Monthly VWAP with Standard Deviation Bands
//@version=4
study("D/W/M VWAPs", overlay=true)
d = input(true, title="Show Daily VWAP")
// dcolor = input(color.gray, type=input.color, title="Daily VWAP Color")
dshowdev = input(true, title="Show Daily VWAP St Dev Band")
w = input(true, title="Show Weekly VWAP")
wshowdev = input(true, title="Show Weekly VWAP St Dev Band")
m = input(true, title="Show Monthly VWAP")
mshowdev = input(true, title="Show Monthly VWAP St Dev Band")
hc = input(true, title="Hide in Own Time Frame")
src = input(title = "Source", type = input.source, defval = hlc3)
stdev1 = input(1.51, title="St Dev")
stdev2 = input(2.51, title="St Dev")
getVwap(period) =>
t = time(period)
start = na(t[1]) or t > t[1]
float[] result = na
sumSrc = src * volume
sumVol = volume
sumVol2 = volume * volume
sumSrc := start ? sumSrc : sumSrc + sumSrc[1]
sumVol := start ? sumVol : sumVol + sumVol[1]
xvwap = sumSrc / sumVol
sumVol2 := start ? volume*src*src : sumVol2[1]+volume*src*src
dev = sqrt(max(sumVol2/sumVol - xvwap*xvwap, 0))
[xvwap, dev]
dvwap = float(na)
dvwapUp1 = float(na)
dvwapUp2 = float(na)
dvwapDn1 = float(na)
dvwapDn2 = float(na)
wvwap = float(na)
wvwapUp1 = float(na)
wvwapUp2 = float(na)
wvwapDn1 = float(na)
wvwapDn2 = float(na)
mvwap = float(na)
mvwapUp1 = float(na)
mvwapUp2 = float(na)
mvwapDn1 = float(na)
mvwapDn2 = float(na)
if (d and timeframe.isintraday and timeframe.period != '60' and timeframe.period != '120' and timeframe.period != '240' and timeframe.period != '720')
[xvwap, dev] = getVwap("D")
dvwap := xvwap
if (dshowdev)
dvwapUp1 := xvwap + stdev1 * dev
dvwapDn1 := xvwap - stdev1 * dev
dvwapUp2 := xvwap + stdev2 * dev
dvwapDn2 := xvwap - stdev2 * dev
if (w and not timeframe.isdaily and not (hc and timeframe.isweekly) and not timeframe.ismonthly)
[xvwap, dev] = getVwap("W")
wvwap := xvwap
if (wshowdev)
wvwapUp1 := xvwap + stdev1 * dev
wvwapDn1 := xvwap - stdev1 * dev
wvwapUp2 := xvwap + stdev2 * dev
wvwapDn2 := xvwap - stdev2 * dev
if (m and not (hc and timeframe.ismonthly))
[xvwap, dev] = getVwap("M")
mvwap := xvwap
if (mshowdev)
mvwapUp1 := xvwap + stdev1 * dev
mvwapDn1 := xvwap - stdev1 * dev
mvwapUp2 := xvwap + stdev2 * dev
mvwapDn2 := xvwap - stdev2 * dev
plot(dvwap, title="Daily VWAP", color=color.gray)
DU1=plot(dvwapUp1, title="Daily VWAP Upper Band 1", color=color.gray)
DD1=plot(dvwapDn1, title="Daily VWAP Upper Band 2", color=color.gray)
DU2=plot(dvwapUp2, title="Daily VWAP Lower Band 1", color=color.gray)
DD2=plot(dvwapDn2, title="Daily VWAP Lower Band 2", color=color.gray)
fill(DU1, DU2, color=color.gray, transp=93, title="Daily Over Bought Fill")
fill(DD1, DD2, color=color.gray, transp=93, title="Daily Over Sold Fill")
fill(DU2, DD2, color=color.gray, transp=93, title="Daily Inner Fill")
plot(wvwap, title="Weekly VWAP", color=color.orange)
WU1=plot(wvwapUp1, title="Weekly VWAP Upper Band 1", color=color.orange)
WD1=plot(wvwapDn1, title="Weekly VWAP Upper Band 2", color=color.orange)
WU2=plot(wvwapUp2, title="Weekly VWAP Lower Band 1", color=color.orange)
WD2=plot(wvwapDn2, title="Weekly VWAP Lower Band 2", color=color.orange)
fill(WU1, WU2, color=color.orange, transp=93, title="Weekly Over Bought Fill")
fill(WD1, WD2, color=color.orange, transp=93, title="Weekly Over Sold Fill")
plot(mvwap, title="Monthly VWAP", color=color.red)
MU1=plot(mvwapUp1, title="Monthly VWAP Upper Band 1", color=color.red)
MD1=plot(mvwapDn1, title="Monthly VWAP Upper Band 2", color=color.red)
MU2=plot(mvwapUp2, title="Monthly VWAP Lower Band 1", color=color.red)
MD2=plot(mvwapDn2, title="Monthly VWAP Lower Band 2", color=color.red)
fill(MD1,MU1, color=color.red, transp=93, title="Monthly Inner Band")
fill(MU1, MU2, color=color.red, transp=93, title="Monthly Over Bought Fill")
fill(MD1, MD2, color=color.red, transp=93, title="Monthly Over Sold Fill")
fill(WU2, WD2, color=color.gray, transp=93, title="Weekly Inner Fill")
Overview
For each enabled period it also draws two standard-deviation bands around the VWAP, with multipliers defaulting to 1.51 and 2.51, and fills the areas between those bands. Toggles show or hide each VWAP and its bands, and an option can hide a VWAP on its own timeframe. Daily VWAP is limited to selected intraday charts. It does not generate entries, exits, or stop levels.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Show Daily VWAP
bool
true
d
Show Daily VWAP St Dev Band
bool
true
dshowdev
Show Weekly VWAP
bool
true
w
Show Weekly VWAP St Dev Band
bool
true
wshowdev
Show Monthly VWAP
bool
true
m
Show Monthly VWAP St Dev Band
bool
true
mshowdev
Hide in Own Time Frame
bool
true
hc
Source
source
hlc3
src
St Dev
float
1.51
stdev1
St Dev
float
2.51
stdev2
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This indicator plots a custom Anchored Volume-Weighted Average Price (VWAP) directly on the price chart along with optional standard deviation bands. Users can anchor the VWAP to standard time periods like sessions, weeks, or months, or to corporate events suc
VWAP - Basic plots an anchored Volume Weighted Average Price directly on the main price chart alongside two standard deviation bands. It calculates typical price weighted by volume, resetting the cumulative calculations at user-selected session, weekly, or mon
This overlay indicator marks the current day's low and a suggested entry zone a fraction of daily ATR below that low. It compares daily volume with a volume moving average, plots daily SMA and EMA distance, and draws an optional ATR-width price cloud. Labels c
This indicator identifies and visualizes key support and resistance zones directly on the price chart using historical 1-hour bar evidence. It calculates zone strength by weighting price rejections, support-resistance flips, relative volume spikes, price gaps,
This overlay indicator marks Wyckoff-style buying and selling climaxes on the price chart. It filters trend with an exponential moving average and a higher-timeframe EMA, then flags accumulation or distribution when price and ATR sit relative to their swing av
This indicator overlays Bollinger Bands on the price chart and fills the area between upper and lower bands using a color based on Cumulative Volume Delta trend. It plots an EMA 9 line and fills between the EMA 9 and Bollinger basis in green or red depending o