Two lengths control different parts of the calculation
For bar t, calculate delta = close[t] − close[t−M], U = max(delta, 0), and D = max(−delta, 0). Smooth U and D separately over N observations, then calculate RMI = 100 × Uavg / (Uavg + Davg). These are price-change magnitudes, not counts of rising and falling bars. Roger Altman introduced RMI as a modification of RSI; the published TradingView implementation by everget also identifies M = 1 as the RSI comparison case.
- Here, Wilder smoothing uses alpha = 1/N. Seed each average with the arithmetic mean of its first N valid changes; afterwards, average[t] = ((N − 1) × average[t−1] + current change) / N.
- For consecutive valid prices, the first RMI value can appear on bar M + N, counting the first price as bar 1. RSI with M = 1 can appear on bar N + 1. Do not fill earlier missing changes with zeros.
- Smoothing type is part of the definition. Sierra Chart exposes several moving-average types and its own initialization and flat-data policy. An SMA or EMA variant need not match the Wilder version below.
| Setting | What it changes | What it does not mean |
|---|---|---|
| M: momentum span | The distance between the two compared closes | An extra moving average of RSI |
| N: smoothing length | The averaging of positive and negative M-bar changes | The distance between those closes |
| Chart timeframe | The duration represented by each bar | M daily bars when the chart is intraday |