vdubus

VDUB BB %B REVERSAL_v4

1090
By Request this is my own personal indicator modification which is just an upgrade from v3

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(title = "VDUB BB %B REVERSAL_v4", shorttitle = "vdub_BB_%B_rev_v4")
length = input(21, minval=1)
src = input(close, title="Source")
mult = input(0.001, minval=0.001, maxval=50)
basis = sma(src, length)
dev = mult * stdev(src, length)
upper = basis + dev
lower = basis - dev
bbr = (src - lower)/(upper - lower)
plot(bbr, color=teal, style=histogram, linewidth=4)
plot(bbr, color=black, style=line, linewidth=2)
plot(bbr, color = change(bbr) <= 0 ? gray : teal, style=line)
//----
barcolor( bbr > 0 ? green :red)
//========================bgcolor=================================
trade_session = input(title='Trade Session:', type=string, defval='0400-1500', confirm=false)
istradingsession2 = not na(time('1', trade_session))
bgcolor(istradingsession2?black:na, transp=80, offset=100, title="Trading session")
//
tf = input('240' )
tf_bool = na(tf_bool[1]) ? 0 : change(time(tf)) and tf_bool[1] == 0 ? 1 : change(time(tf)) and tf_bool[1] == 1 ? 0 : tf_bool[1]
bgcolor(tf_bool == 1 ? gray : silver, transp=70, offset=100, title="BO Expiry")