Advertisement
TheLark

Trading View Indicator: RMI

Feb 19th, 2014
942
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. study(title = "TheLark Relative Momentum Index (RMI)",overlay=false)
  2.  
  3. //•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•//
  4. // //
  5. // RMI BY THELARK //
  6. // ~ 2-19-14 ~ //
  7. // //
  8. // •/• //
  9. // //
  10. // https://www.tradingview.com/u/TheLark //
  11. // //
  12. //•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•//
  13.  
  14. // Relative Momentum Index (RMI)
  15. // "... The Relative Momentum Index was developed by Roger Altman
  16. // and was introduced in his article in the February, 1993 issue of
  17. // Technical Analysis of Stocks & Commodities magazine. "
  18. // "... While RSI counts up and down days from close to close, the Relative
  19. // Momentum Index counts up and down days from the close relative to a
  20. // close x number of days ago. "
  21.  
  22. // Requested by glaz @ TradingView
  23.  
  24. // inputs
  25. len = input(20, title="Length")
  26. mom = input(4, title="Momentum",minval=0)
  27. ob = input(70,title="Overbought")
  28. os = input(30,title="Oversold")
  29. c = close
  30. dosignal = input(true,title="Show Signal Line?")
  31. sig = input(6,title="Signal Length")
  32. dohist = input(true,title="Show Hist?")
  33. //calc
  34. up = ema(max(c - c[mom],0),len)
  35. dn = ema(max(c[mom] - c,0),len)
  36. rmi = dn == 0 ? 0 : 100 - 100 / (1 + up / dn)
  37. signal = sma(rmi,sig)
  38.  
  39. //plots
  40. hline(ob)
  41. hline(os)
  42. plot(dosignal and dohist?(rmi-signal)+50:na,color=#FF006E,histbase=50,style=histogram,linewidth=2)
  43. plot(dosignal?signal:na,color=#D87A68)
  44. plot(rmi, color=#42B0FF,linewidth=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement