indicator · own pane · open source
Relative Momentum
Running…
Loading chart…
About
Relative Momentum — rate-of-change of price minus rate-of-change of its SMA. Positive = price is accelerating faster than its own average (momentum building), negative = losing steam.
- Lead reversal sign so turns at 0 are early warnings for trend changes.
Source code
//@version=5
indicator("Relative Momentum", overlay=false)
len = input.int(14, "Length", minval=5, maxval=100)
rmom = ta.roc(close, len) - ta.roc(ta.sma(close, len), len)
hline(0, "Zero", color=color.gray)
p_Rel_Mom = plot(rmom, "Rel Mom", color=color.blue, linewidth=2)
alertcondition(ta.crossover(rmom, 0), "Momentum up", "Relative momentum crossed above zero")
alertcondition(ta.crossunder(rmom, 0), "Momentum down", "Relative momentum crossed below zero")
No comments yet.
Sign in to comment.