Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=4
- study(title="SR REDJ0HN", shorttitle="Stoch RSI", format=format.price, precision=2, resolution="")
- smoothK = input(3, "K", minval=1)
- smoothD = input(3, "D", minval=1)
- lengthRSI = input(14, "RSI Length", minval=1)
- lengthStoch = input(14, "Stochastic Length", minval=1)
- src = input(close, title="RSI Source")
- rsi1 = rsi(src, lengthRSI)
- k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
- d = sma(k, smoothD)
- plot(k, "K", color=#2962FF, linewidth=2)
- plot(d, "D", color=#FF6D00, linewidth=2)
- h0 = hline(80, "Upper Band", color=#FF5252)
- h1 = hline(20, "Lower Band", color=#4CAF50)
- h2 = hline(100, "Upper Band", color=#363A45)
- h3 = hline(0, "Lower Band", color=#363A45)
- buySignalr = crossover(k, d)
- plotshape(buySignalr ? k*0.950 : na, title="Buy", text="*", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0)
- sellSignallr = crossunder(k, d)
- plotshape(sellSignallr ? d*1.050 : na, title="Sell", text="-", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0)
Advertisement
Add Comment
Please, Sign In to add comment