Guest User

StochRSI with Volatility Bands [LazyBear]

a guest
Jul 26th, 2014
10,548
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. //
  2. // @author LazyBear
  3. // List of all my indicators: https://www.tradingview.com/v/4IneGo8h/
  4. //
  5. study(title="Stochastic RSI with Volatility Bands [LazyBear]", shorttitle="StochRSIBB_LB")
  6. source = close
  7. lengthRSI = input(14, minval=1), lengthStoch = input(14, minval=1)
  8. smoothK = input(3, minval=1), smoothD = input(3, minval=1)
  9. rsi1 = rsi(source, lengthRSI)
  10. k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
  11. d = sma(k, smoothD)
  12. plot(k, color=blue)
  13. plot(d, color=orange)
  14. h0 = hline(80)
  15. h1 = hline(20)
  16. fill(h0, h1, color=purple, transp=80)
  17.  
  18. // Calc volatility bands
  19. length=input(20, title="BB Length"), mult=input(2.0, title="BB stdev multiplier")
  20. x=k
  21. srcx=x
  22. basisx=sma(srcx, length)
  23. devx = (mult * stdev(srcx, length))
  24. ulx = (basisx + devx)
  25. llx = (basisx - devx)
  26. plot(x>=ulx? x : na, color=blue, style=cross, linewidth=3 )
  27. plot(x<=llx? x : na, color=blue, style=cross, linewidth=3 )
Advertisement
Comments
Add Comment
Please, Sign In to add comment