vdubus

Vdub_BinaryBands_v1

Combined 3 x Bollinger Bands With BUY & SELL zones
EMA,
Wma
SMA
Multiplier adjustment

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
study(shorttitle="Vdub_BinaryBands_v1", title="Vdub_BinaryBands_v1", overlay=true)
//-----------------BB 1 ema------------------------------------------
length = input(21, minval=1)
src = input(close, title="Source")
mult = input(2.0, minval=0.001, maxval=50)
basis = ema(src, length)
dev = mult * stdev(src, length)
upper = basis + dev
lower = basis - dev
plot(basis, color=red, style=line,linewidth=2, title="ema Base 1")
p1 = plot(upper, color=blue, style=line,linewidth=1, title="ema hi")
p2 = plot(lower, color=blue, style=line,linewidth=1, title="ema low")
fill(p1, p2, color=blue, transp=85, title="ema bg 1")
//-----------------BB 2 wma-------------------------------------------
length2 = input(21)
src2 = input(close, title="Source")
mult2 = input(2.0, minval=0.001, maxval=50)
basis2 = wma(src, length)
dev2 = mult2 * stdev(src2, length2)
upper2 = basis2 + dev2
lower2 = basis2 - dev2
plot(basis2, color=maroon, style=line,linewidth=2, title="wma Base 2")
p12 = plot(upper2, color=green, style=line,linewidth=1, title="wma hi")
p22 = plot(lower2, color=green, style=line,linewidth=1, title="wma low") 
fill(p12, p22, color=blue, transp=90, title="wma bg 2")
//-----------------BB 3 sma-----------------------------------------
length3 = input(21, minval=1)
src3 = input(close, title="Source")
mult3 = input(2.0, minval=0.001, maxval=50)
basis3 = sma(src, length3)
dev3 = mult3 * stdev(src3, length3)
upper3 = basis3 + dev3
lower3 = basis3 - dev3
plot(basis3, color=red, style=line,linewidth=2, title="sma Base 3")
p13 = plot(upper3, color=black, style=line,linewidth=1, title="sma hi")
p23 = plot(lower3, color=black, style=line,linewidth=1, title="sma low")
fill(p13, p23, color=black, transp=85, title="sma bg 3")
//------------------------------------------------------------------//
fill(p1, p12, color=red, transp=50, title="sell bg")
fill(p2, p22, color=lime, transp=50, title="Buy bg")