The Relative Vigor Index (RVI) is a momentum oscillator built on a simple idea: in a genuinely strong trend, price should close well away from where it opened, relative to how wide the bar's total range was. RVI measures that "vigor" directly — how convincingly each candle closes in the direction it moved — rather than measuring price's speed or its position inside a recent high-low band the way most other oscillators do.
How RVI Is Calculated
Most oscillators compare the current close to a past close (RSI) or to a recent high-low range (Stochastic). RVI compares two things that both live inside the same candle:
- Close minus Open — how far price traveled from its opening print by the close, in the direction of that move. A wide close-minus-open gap means buyers (or sellers) pushed hard and held their ground all bar.
- High minus Low — the full range the price traded through during that same bar, in either direction.
The ratio of the two is the whole concept: a bar that closes far from its open relative to its own range is a "vigorous" bar — the move wasn't just noise, price used most of its range to travel in one direction and stayed there. A bar with a wide high-low range but a close that lands back near the open is a wide, indecisive bar — lots of back-and-forth, no real conviction either way.
Both the numerator (close-open) and the denominator (high-low) are smoothed with a weighted average across four bars before being compared, which filters out single-bar noise, and the smoothed ratio is then averaged over the lookback period — 10 bars by default — to produce the main RVI line. A Signal line is then calculated as a moving average of the main line itself, exactly the same relationship %D has to %K in Stochastic. The two lines oscillate around a zero centerline with no fixed upper or lower bound — positive values mean closes have generally landed away from opens in the direction of up moves, negative values the mirror image for down moves.
Reading the Main/Signal Cross Around Zero
Because RVI has no fixed ceiling or floor the way RSI or Stochastic do, there's no "overbought at 80" or "oversold at 70" zone to wait for. The signal that matters is the main line crossing the signal line, read against the zero line for context:
- A cross happening above zero confirms closes have been consistently landing in the direction of an up move — a bullish cross here is trading with an already-established vigorous move.
- A cross happening below zero is the mirror case for a down move.
- A cross happening near zero, right as price is chopping sideways, usually means neither side has shown real conviction yet — treat these as weaker signals than a cross that happens well away from the centerline.
The diagram above shows the classic shape: price rallies, RVI's main line pushes into positive territory ahead of the signal line, the BUY cross fires as the main line turns up through the signal line, then later, as the rally stalls and reverses, the main line rolls over and crosses back down through the signal line for the SELL.
Entry Conditions
- BUY — the RVI main line crosses above the signal line.
- SELL — the RVI main line crosses below the signal line.
That's the entire rule, and it's deliberately the same shape as a %K/%D cross — one fast line, one smoothed line, act on the cross. The included indicator (rvi-alert.mq4/.mq5) implements exactly this: it checks whether the main line was at or below the signal line on the previous closed bar and is now above it (or the reverse), fires an alert the first time that happens, and won't re-fire on the same cross state until the lines flip the other way — so a single crossing produces one alert, not a stream of repeated ones while the lines sit close together.
Because there's no zone requirement like Stochastic's 80/20, every cross technically qualifies as a signal — which is exactly why pairing the cross with the zero-line context above (and with the trend filters discussed in "A Word of Caution" below) matters more for RVI than it does for a bounded oscillator with built-in extremes to wait for.
Parameters
- RVIPeriod (default
10) — the lookback window used to average the smoothed close-open/high-low ratio into the main line. A shorter period reacts faster to fresh vigor but throws more crosses in choppy conditions; a longer period smooths further and lags more, similar to lengthening the %K period in Stochastic. - EnableAlert (default
true) — pop up a terminal Alert the first time the main line crosses the signal line in a new direction. - EnablePush (default
false) — also send a push notification to the MetaTrader mobile app on the same crossover event, useful for anyone not watching the chart live.
There's no separate "signal period" input to tune here the way MACD exposes its own 9-period EMA — RVI's signal line smoothing is fixed as part of the standard calculation, so RVIPeriod is the one dial that reshapes the whole indicator.
RVI vs Stochastic: Same Cross Idea, Different Calculation
RVI and Stochastic look almost identical on a chart — two oscillating lines, crosses generating BUY/SELL signals — and that resemblance is intentional to read, but the two measure genuinely different things:
- Stochastic asks: where does the current close sit within the recent high-low range? It's a position-in-range measurement, comparing the close to a lookback window of past bars.
- RVI asks: how far did this bar's close travel from its own open, relative to its own range? It's a within-bar conviction measurement, comparing a bar to itself rather than to its neighbors.
The practical difference shows up in trending markets. Stochastic can pin near 80 or 100 for long stretches in a strong trend simply because closes keep landing near the top of the recent range — which is why it's prone to firing repeated "overbought, sell" signals that a trend just runs straight through. RVI doesn't have that specific failure mode in the same way, because it isn't measuring position in a range at all — it keeps producing fresh positive readings as long as individual bars keep closing strongly in the trend direction, and only turns when the bars themselves stop doing that. Neither is "better" outright; they answer different questions, and traders who run both together are looking at range position and bar-level conviction side by side rather than double-counting the same signal.
A Word of Caution
RVI's biggest limitation is one it shares with MACD and Stochastic: the cross confirms a shift in vigor only after it happens, so it's a reactive signal, not a predictive one. In a choppy, low-conviction market, individual bars close near their own open regardless of direction, which keeps RVI's main line hovering near zero and weaving back and forth across the signal line — generating repeated, low-value crosses in exactly the conditions where "vigor" doesn't exist to measure. Check the broader market state first with Trend vs Range before trusting a cross; RVI crosses mean far more inside an established, well-formed trend than during a sideways grind. It also pairs well with a genuine trend filter — only taking bullish crosses while price sits above a longer Moving Average, for instance — the same discipline recommended for Stochastic and MACD crosses. As with any indicator on this site, this is source code to review and a concept to understand, not a signal to follow blindly — always confirm with price structure and proper risk management before acting on it.
Download the Indicator
This custom indicator plots the RVI main line and Signal line, with automatic alerts when they cross. It's available for both MetaTrader 4 and MetaTrader 5 below.
How to Install — MetaTrader 4
- Download the
rvi-alert.mq4file below. - Open MetaTrader 4 → click
File→Open Data Folder. - Place the file in the
MQL4/Indicatorsfolder. - Restart MetaTrader 4, then drag the indicator from the Navigator window onto the chart.
How to Install — MetaTrader 5
- Download the
rvi-alert.mq5file below. - Open MetaTrader 5 → click
File→Open Data Folder. - Place the file in the
MQL5/Indicatorsfolder. - Restart MetaTrader 5, then drag the indicator from the Navigator window onto the chart.
Both files are source code — open and review the full code before using it, for your own safety.