Advertisement
JustUncleL

ROC and SROC

Oct 18th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. //@version=3
  2.  
  3. study("ROC and SROC by JustUncleL")
  4.  
  5. roclen= input(21, minval=1, title="ROC Length")
  6. emalen= input(13, minval=1, title="EMA Length")
  7. smoothing = input(21, minval=1, title="SROC Length")
  8. src = input(close, title="ROC Source")
  9.  
  10. EMA = ema(src, emalen)
  11. ROC = roc(src, roclen)
  12. SROC = roc(EMA, smoothing)
  13.  
  14. //hline(rocThreshold,linestyle=dotted,color=gray)
  15. hline(0,linestyle=dashed,color=gray)
  16. //hline(0-rocThreshold,linestyle=dotted,color=gray)
  17.  
  18. plot(ROC, color=blue, linewidth=1)
  19. plot(SROC,style=line, color=SROC>0?green:red, linewidth=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement