repo32

Bollinger Band Touch

This script simply colors the background when price hits or exceeds the bollinger bands. Just a nice visual cue.
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?
//Created by Robert Nance 7/5/15
//This script simply colors the background when price hits or exceeds the bollinger bands
//Works nice if you need a quick cue when you are playing the bounce.
study(shorttitle="BB", title="Bollinger Band Touch", overlay=true)
length = input(20, minval=1)
src = input(close, title="Source")
mult = input(2.0, minval=0.001, maxval=50)
basis = sma(src, length)
dev = mult * stdev(src, length)
upper = basis + dev
lower = basis - dev
plot(basis, color=red)
p1 = plot(upper, color=red)
p2 = plot(lower, color=green)
fill(p1, p2)
toptouch = high >= upper ? red : na
bottouch = low <= lower ? green : na

bgcolor(toptouch, transp=75)
bgcolor(bottouch, transp=75)