Relative Momentum Index Formula (RMI) and Its Blind Spot
The relative momentum index formula in four steps, the one-line test that proves an implementation, and the reversal the line refuses to show.
The relative momentum index is RSI with one substitution: each close is compared with the close m bars back instead of the close immediately before it. The formula is RMI = 100 x AvgUp / (AvgUp + AvgDown), where the up and down moves are those m-bar changes and both averages use Wilder smoothing over a length n.
Set m to 1 and the line is RSI, to the last decimal. Leave m at 5 and a pullback smaller than the preceding five-bar advance produces no down value at all, so the line can read 100.00 while price is falling.
Roger Altman published it in the February 1993 issue of Technical Analysis of Stocks and Commodities.
What is the relative momentum index?
An oscillator bounded 0 to 100 that measures the size of up moves against the size of down moves, where "up" and "down" are judged over several bars instead of one.
Altman's own description, quoted from a community library page that reproduces it on prorealcode.com: "the RSI is modified by counting up and down days starting from today's close relative to the close Y days ago, where Y is not necessarily 1 as required by the RSI. The RSI is released from the arbitrary restriction of comparing consecutive days for price changes". He goes on to say that at a period of 20 with Y set at 5, the result is "easier to anticipate tradable reversal points compared with the one-parameter RSI". That is his claim about his own indicator, made in 1993.
RMI is not the RVI. MetaTrader's iRVI is the Relative Vigor Index, and "RVI" is also used for the Relative Volatility Index.
What is the RMI formula?
Four steps. Pick a length n and a momentum step m.
- Momentum per bar:
change = close - close[m]. Note the index. It is m bars back, not one. - Split it:
up = max(change, 0),down = max(-change, 0). Down moves go in as positive numbers. - Smooth each series over n with Wilder's average. The first value is a simple mean of the first n values, and every value after it is
(previous x (n - 1) + current) / n. - Scale it:
RMI = 100 x AvgUp / (AvgUp + AvgDown).
You will also see it written the way RSI usually is: RMI = 100 - 100 / (1 + AvgUp / AvgDown). The two forms are the same number. With an average up of 46 and an average down of 24, both give 65.7143, as does the third writing you will meet, 100 x r / (1 + r) with r = AvgUp / AvgDown.
They part company when the average down is zero: the first form gives 100 straight away, while the other two divide by zero before they can be rescued by convention. marketvolume.com states the convention plainly: "When the average down is zero, RMI is defined as 100". The ProRealTime community implementation computes rm = up / dn and then 100 * rm / (1 + rm), which is that division by zero, on exactly the straight-line advance where the indicator is supposed to read 100.
Three details carry most of the porting bugs, and marketvolume names all three: the lookback must reach back m bars rather than one, the first smoothed value must be a simple mean of the first n values rather than a recursion started from a single change, and "the smoothing weight is 1 ÷ len, which is Wilder's average, not 2 ÷ (len + 1)". The last one is the nastiest, because a conventional exponential average lands near enough to pass a glance and is wrong all the way through.
onetradejournal.com publishes a worked example on an illustrative series. Up values of 0, 0, 0, 200 and 30 average to 46, down values of 70, 30, 20, 0 and 0 average to 24, and 100 x 46 / 70 gives 65.71. One Wilder step later, with an up value of 250 and a down value of 0, the averages become 86.8 and 19.2 and the reading is 81.89.
Does ChartLabs have the RMI?
Yes, as Relative Momentum Index. Open the chart's Indicators menu, go to the Standard list, and look under the Momentum & Oscillators heading. It opens in its own pane below price.
It follows the four steps above, with the Wilder smoothing seeded by a simple mean. Three settings: Length 20 and Momentum 5, which are Altman's own numbers, and Source, which defaults to the close. It draws lines at 70 and 30.
Two readings are worth knowing before you build a rule on it. When the average down move is zero it reads 100, which is the convention. It also reads 100 on a dead-flat window, where the formula itself is undefined, so treat a flat 100 on a quiet market as no reading rather than as a maximum. Set Momentum to 1 and it is Wilder's RSI at the same length.
Is RMI just RSI?
No, but it contains it. With the momentum step at 1, step 1 of the formula becomes RSI's step 1, and everything downstream is already identical: the same split into up and down, the same Wilder smoothing, the same scaling. So the two lines cannot differ, and any difference you see is a bug.
That gives you a test: set the momentum step to 1, run it beside a known-good Wilder RSI at the same length, and compare. marketvolume sets exactly the same test: "the two must agree to the last decimal, because with that setting they are the same formula".
If your two lines disagree at m equals 1, the bug is in the smoothing or the seed, not in the momentum lookback. If they agree at m equals 1 and your line still looks wrong at m equals 5, the lookback index is where to look.
What are the RMI settings, and what do they do?
Two parameters, and the published answers do not agree.
| Source | Length | Momentum step |
|---|---|---|
| Altman, quoted on prorealcode.com | 20 | 5 |
| marketvolume.com | 20 | 5 |
| onetradejournal.com | varies by instrument | 4 or 5 on sharper movers |
| forex.in.rs | 14 as a starting point | 5, though the same page elsewhere says the momentum default is often 1 |
| luxalgo.com | no standard | no standard |
luxalgo sums it up: "There is no single standard setting: published examples pair a longer smoothing length with a momentum step of several bars, and platform defaults vary".
What each dial does is clearer than what it should be set to. The length controls how much history each reading aggregates, exactly as on RSI. The momentum step controls what counts as an up bar in the first place, which is a different kind of change.
What does the momentum step actually buy, and what does it cost?
It buys persistence through small pullbacks. It costs you the ability to see a reversal smaller than the move it looks back over.
Take an illustrative series at length 5 that rises 2 a bar for sixteen bars, then falls 1 a bar for three bars. The last six closes are 126, 128, 130, 129, 128, 127. Price has turned down and stayed down for three bars.
| Reading | Momentum step 1 | Momentum step 5 |
|---|---|---|
| First down bar | 88.89 | 100.00 |
| Second down bar | 78.05 | 100.00 |
| Third down bar | 67.72 | 100.00 |
With the step at 5, the line does not move at all. On those three bars, close minus close five bars back is 7, then 4, then 1. All still positive, so all three go into the up series and the down series gets nothing.
With a momentum step of m, a reversal smaller than the preceding m-bar move produces no down value at all. The smoothness is a blind spot built into the input rather than a filter applied after the fact.
That is a reason to size the step against the swings you actually hold. If your typical pullback runs three bars and your momentum step is 5, the oscillator will never register it, and whether that is the feature or the failure depends on what you were trying to see.
What happens on a flat market or a straight line?
Three branches, two of which are documented and one of which is not.
- Straight-line advance: the average down is zero, and the index is defined as 100 by convention. A rising series gives exactly 100.00.
- Straight-line decline: the average up is zero, the ratio is zero, and the formula gives 0 with no special casing needed. Exactly 0.00.
- Dead flat, every close identical: both averages are zero, so the index is 0 divided by 0. Undefined. Not 50, not 100, not 0.
The third case is the one the published descriptions leave open, and every implementation has to choose something there. Feed your indicator twenty identical closes and see what it returns. A NaN, a 50 and a 100 are three different answers to the same question, and only one of them will match whatever you compare it against later.
Do 70 and 30 mean the same as on RSI?
No. The sources that address it agree that extremes are easier to reach and easier to hold.
luxalgo puts it as "the classic 70/30 bands mark less exceptional conditions than they do on RSI". marketvolume lists reused RSI thresholds first among its failure modes, and notes that users on a momentum of 5 often widen the bands. patternswizard.com publishes wider ranges outright, calling 70 to 90 overbought and 10 to 30 oversold.
A threshold quoted for RSI does not carry over unchanged, because the momentum step has changed how often the line can get there. Which bands to use on your own instrument is a thing to measure, not to copy.
Why do some descriptions of the RMI have no momentum step in them?
Because two of the pages that rank for the term describe a different construction, and both contradict themselves further down.
forex.in.rs describes it as RSI smoothed twice: "the Relative Momentum (RM) is derived by smoothing the RS values using exponential moving averages (EMA). Finally, the RMI is calculated by applying another EMA to the RM values". There is no momentum step anywhere in that, and the same page's own step 1 further down gives PC = Close - Close[x], which is the real construction. It also calls the index a "centered oscillator", which it cannot be while bounded 0 to 100.
patternswizard.com's rules section discusses the wrong indicator entirely, telling readers to "Close a long position when the RSI falls below 70" and "Go short when the RSI falls below 30" on a page about the RMI, and writes the index with a percent sign. Those are quoted here as errors, not repeated as rules.
onetradejournal calls out the error explicitly: "Many websites wrongly describe RMI as RSI calculated over longer intervals. That is not correct". Lengthening RSI changes the smoothing. The momentum step changes the measurement.
Where do I get the RMI?
Some platforms ship a study under this name, and some do not.
| Platform | What it has |
|---|---|
| thinkorswim | A study named RelativeMomentumIndex, which its own reference gives a length and a momentum input and an RMI, an OverBought and an OverSold plot |
| Sierra Chart | A Relative Momentum Index study whose own reference lists an RMI Length, an RMI Moving Average Length and an RMI Moving Average Type, and writes the formula in terms of simple moving averages, with Wilder's among the types you can select instead |
| ProRealTime | A community library ProBuilder implementation, dated April 2017, with the division-by-zero issue described above |
| MetaTrader | Nothing. MQL5's own indicator index has iMomentum, iRSI and iRVI, and no RMI on either MT4 or MT5 |
| ChartLabs | Built in as Relative Momentum Index, under Standard in the Indicators menu, with a Length of 20 and a Momentum of 5 |
The 70 and 30 we draw are the RSI's own bands rather than levels anyone measured for the RMI, so read them as a reference grid and not as a tested threshold. The indicator draws the line and nothing more, so there is no automatic backtest of a rule built on it.
How would I test whether the smoother line helps?
Run the same rule twice on the same bars, once at m equals 1 and once at m equals 5, and compare when each one let you out rather than which one made more.
A procedure that produces something readable:
- Fix both parameters before the first trade and write them down. Tuning two dials against the same history is the fastest route to a number that means nothing out of sample.
- Run the identical entry and exit rule at both momentum steps over the identical bars. The only difference between the two runs must be m.
- Record the exit bar for every occurrence, not the ones that worked. The question is how late the smoother line let go.
- Count the trades both ways and write the count down beside the result.
For the material, ChartLabs gives you cleaned 1-minute candles from Dukascopy data and the timeframes above them, which is the close series this formula needs, and bar-by-bar replay so you take each trade by hand with only the bars you would have had at the time. Every trade keeps a snapshot of the chart as it looked when you entered, you can tag trades and filter the analytics by tag, and the CSV export gives you somewhere to write both parameters beside the result.
One next step
Set the momentum step to 1, check your RMI against your RSI, then step through your own history and watch where the two part company. Start the free trial and run it on cleaned data.
Related reading: how to backtest a strategy step by step, why data quality changes your results, and manual versus automated backtesting.
Related Topics
Related
Backtesting a Trading Strategy: A Beginner's Guide
What backtesting is, why it matters, and how to run one step by step: defining your rules, choosing clean historical data, stepping through the chart trade by trade, logging results, and reading the metrics that tell you whether your strategy has a real edge.
Backtesting Accuracy: How Slippage and Data Quality Matter
Why backtest results and live results drift apart, and what actually closes the gap: clean tick data, honest spread assumptions, and commission and slippage modelled directly on every trade you log.
Manual vs Automated Backtesting: Which One Should You Use?
Automated backtesting tells you whether a set of rules made money. Manual backtesting tells you whether you can trade them. A practical comparison of what each one tests, what it costs you in time and skill, and which to reach for first.