vdubus

BUBBLE_GUM_VB3_v1

273
BUBBLE_GUM_VB3_v1
Designed for short term trading / experimental
Combination of 3 x Bollinger bands
& Binary Pro 3.

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="BUBBLE_GUM_VB3_v1", title="BUBBLE_GUM_VB3_v1", overlay=true)
//-----------------BB 1-------------------------------------------
length = input(60, minval=1)
src = input(close, title="Source")
mult = input(1.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, style=line,linewidth=2, title="Base")
p1 = plot(upper, color=blue, style=line,linewidth=2, title="BB1 hi")
p2 = plot(lower, color=blue, style=line,linewidth=2, title="BB1 low")
fill(p1, p2, transp=70)
//-----------------BB 2-------------------------------------------
bb1_src = close
bb1_l = input(60, minval=2), bb1_mult = input(2, minval=0.001, maxval=400)
bb1_dev = bb1_mult * stdev(bb1_src, bb1_l)
bb1_upper = basis + bb1_dev
bb1_lower = basis - bb1_dev
bb1_p1 = plot(bb1_upper, color=fuchsia, style=line,linewidth=2, title="BB2 hi")
bb1_p2 = plot(bb1_lower, color=fuchsia, style=line,linewidth=2, title="BB2 low")
fill(bb1_p1, bb1_p2, transp=80)
//-----------------BB 3 -----------------------------------------
bb2_src = close
bb2_l = input(60, minval=3), bb2_mult = input(3, minval=0.001, maxval=400)
bb2_dev = bb2_mult * stdev(bb2_src, bb2_l)
bb2_upper = basis + bb2_dev
bb2_lower = basis - bb2_dev
bb2_p1 = plot(bb2_upper, color=green, style=line,linewidth=2, title="BB3 hi")
bb2_p2 = plot(bb2_lower, color=green, style=line,linewidth=2, title="BB3 low")
fill(bb2_p1, bb2_p2, transp=90)
//=========================================================
source = close
length3 = input(56, minval=1, title = "WMA Length")
atrlen = input(100, minval=1, title = "ATR Length")
mult1 = 2
mult2 = 3
ma = wma(source, length3)
range =  tr
rangema = wma(range, atrlen)

up1 = ma + rangema * mult1
up2 = ma + rangema * mult2

dn1 = ma - rangema * mult1
dn2 = ma - rangema * mult2

color1 = black
color2 = black

u4 = plot(up1, color = color1)
u8 = plot(up2, color = color2)

d4 = plot(dn1, color = color1)
d8 = plot(dn2, color = color2)

fill(u8, u4, color=#30628E, transp=55)
fill(d8, d4, color=#30628E, transp=55)
fill(d4, u4, color=#128E89, transp=80)

//Linear regression band
//Input
nlookback = input (defval = 20, minval = 1, title = "Number of Lookback")
scale = input(defval=1,  title="scale of ATR")
nATR = input(defval = 14, title="ATR Parameter")

//Center band
periods=input(34, minval=1, title="MA Period")
pc = input(true, title="MA BAND")

hld = iff(close > sma(high,periods)[1], 1, iff(close<sma(low,periods)[1],-1, 0))
hlv = valuewhen(hld != 0, hld, 1)

hi = pc and hlv == -1 ? sma(high, periods) : na
lo = pc and hlv == 1 ? sma(low,periods) : na
plot(avg(sma(high,periods)+2.5*(sma(high,periods)-sma(low,periods)),sma(low,periods)-2.5*(sma(high,periods)-sma(low,periods))), color=red, style=line,linewidth=4)
plot(pc and sma(high, periods) ? sma(high, periods):na ,title="Swing High Plot", color=black,style=line, linewidth=1)
plot(pc and sma(low,periods) ? sma(low,periods) : na ,title="Swing Low Plot", color=black,style=line, linewidth=1)
//fill(hlv,hld,color=#1c86ee,transp=80)
//-------------------------------------------------------------------------------------------
// Base line_VX1
source3 = close
short = sma(close, 3)
long = sma(close, 13)
plot(short, color=red, linewidth=2)
plot(long, color=navy, linewidth=4)
plot(cross(long, short) ? long : na, style = circles, color=navy, linewidth = 4)
OutputSignal = long >= short ? 1 : 0
bgcolor(OutputSignal>0?red:gray, transp=100)
//=======================================================