Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=4
- study(title="Bitbloxx BB vol filter", overlay=true)
- length = input(15, minval=1)
- mult = input(1.66, minval=0.001, maxval=50)
- src = input(close, title="Source")
- basis = sma(src, length)
- dev = mult * stdev(src, length)
- upper = basis + dev
- lower = basis - dev
- plot(basis, color=color.red)
- p1 = plot(upper, color=color.blue)
- p2 = plot(lower, color=color.blue)
- fill(p1, p2)
- avgvol48 = ema(volume,48)*close
- longcond = (close<=lower)
- cond1 = (avgvol48>=30000)
- var sellLevel = 0.
- if longcond
- sellLevel := close * 1.06
- sellCondition = close > sellLevel
- bgcolor(sellCondition ? color.red : na)
- plot(sellLevel, "Sell Level", color.fuchsia, 2)
- plotshape(cond1 and longcond, title="Long", style=shape.triangleup, location=location.belowbar , text= "BB" , color=color.black, size=size.small)
- alertcondition(cond1 and longcond, "BB Long")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement