Advertisement
PineCoders

Bitbloxx BB vol filter

Dec 26th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. //@version=4
  2. study(title="Bitbloxx BB vol filter", overlay=true)
  3. length = input(15, minval=1)
  4. mult = input(1.66, minval=0.001, maxval=50)
  5. src = input(close, title="Source")
  6. basis = sma(src, length)
  7. dev = mult * stdev(src, length)
  8. upper = basis + dev
  9. lower = basis - dev
  10. plot(basis, color=color.red)
  11. p1 = plot(upper, color=color.blue)
  12. p2 = plot(lower, color=color.blue)
  13. fill(p1, p2)
  14. avgvol48 = ema(volume,48)*close
  15. longcond = (close<=lower)
  16. cond1 = (avgvol48>=30000)
  17.  
  18. var sellLevel = 0.
  19. if longcond
  20. sellLevel := close * 1.06
  21. sellCondition = close > sellLevel
  22. bgcolor(sellCondition ? color.red : na)
  23. plot(sellLevel, "Sell Level", color.fuchsia, 2)
  24.  
  25. plotshape(cond1 and longcond, title="Long", style=shape.triangleup, location=location.belowbar , text= "BB" , color=color.black, size=size.small)
  26. alertcondition(cond1 and longcond, "BB Long")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement