Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- study("ROC and SROC by JustUncleL")
- roclen= input(21, minval=1, title="ROC Length")
- emalen= input(13, minval=1, title="EMA Length")
- smoothing = input(21, minval=1, title="SROC Length")
- src = input(close, title="ROC Source")
- EMA = ema(src, emalen)
- ROC = roc(src, roclen)
- SROC = roc(EMA, smoothing)
- //hline(rocThreshold,linestyle=dotted,color=gray)
- hline(0,linestyle=dashed,color=gray)
- //hline(0-rocThreshold,linestyle=dotted,color=gray)
- plot(ROC, color=blue, linewidth=1)
- plot(SROC,style=line, color=SROC>0?green:red, linewidth=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement