Forex
EA

EA: RVI Signal Cross Expert Advisor

Last updated 2026-07-19

An Expert Advisor (EA) is different from every other download on this site — an indicator only plots or alerts, while an EA actually sends orders on your behalf. This free EA trades a single, transparent momentum strategy built on the Relative Vigor Index end to end: entry, Stop Loss, Take Profit, and position size, all calculated automatically the moment a qualifying signal appears.

How the Strategy Works

The entry signal is a main-line/signal-line crossover on RVI — the exact same shape of signal as a %K/%D cross on Stochastic, but built from a completely different calculation underneath. RVI's main line measures how convincingly each candle closes away from its open relative to that candle's own high-low range, smoothed over a lookback period (RVIPeriod, default 10); the signal line is a moving average of that main line. A BUY setup fires the moment the main line crosses from at-or-below the signal line to above it; a SELL setup is the exact mirror, the main line crossing from at-or-above down through the signal line. There's no zone requirement here — no waiting for an extreme reading the way an overbought/oversold-filtered EA would — every qualifying cross is treated as a valid signal, which keeps the logic simple but also means the trend-strength discussion further down matters more for an EA built this way.

Both lines oscillate around a zero centerline with no fixed upper or lower bound, unlike Stochastic's bounded 0-100 range. That has no bearing on whether a cross counts as a signal in this EA's code — a cross is a cross whether it happens above, at, or below zero — but it does affect how much conviction sits behind it, a distinction covered in the comparison section below.

Stop Loss, Take Profit, and Position Sizing

PriceTake Profit (TP)Stop Loss (SL)BUY0RVI / Signal (oscillates around zero)
Entry conditions: BUY when RVI crosses above its Signal line — SELL on the mirrored cross below — SL and TP are placed automatically from ATR

Both Stop Loss and Take Profit are sized from ATR rather than a fixed pip distance — a volatile pair or session gets a wider stop automatically, and a calm one gets a tighter stop, so the stop always reflects what the market is actually doing right now rather than an arbitrary number picked in advance. The Stop Loss distance is ATRMultiplier × ATR (default multiplier 2.0), placed beyond the entry on the side the trade could be wrong. Take Profit is then set at a multiple of that same Stop Loss distance — the RiskRewardRatio input, default 2.0 — so every trade this EA opens targets twice as much reward as it risks, regardless of which pair or session it fires on.

Position size is calculated from a RiskPercent input (default 1.0%) against your account balance and the Stop Loss distance — the exact worked-example method from Risk Management Basics: risk amount ÷ Stop Loss distance (converted through the symbol's tick value) = lot size. A wider ATR-based stop on a volatile day automatically produces a smaller lot, and a tighter stop on a calm day produces a larger one, so the dollar amount actually at risk stays roughly constant trade to trade. A UseFixedLot input is available as an escape hatch for traders who'd rather trade a constant lot size regardless of the calculated risk.

Entry Conditions

  • BUY — the RVI main line crosses from at-or-below its signal line to above it.
  • SELL — the RVI main line crosses from at-or-above its signal line to below it.

The EA only evaluates these conditions once per new bar (not on every tick), only opens one position at a time, and only manages positions tagged with its own magic number (MagicNumber, default 20260734) — so it won't interfere with trades you open manually on the same account, and it won't stack additional trades on top of an open one. A MaxSpreadPoints filter also blocks new entries when the current spread is too wide, since a signal that looks good on the chart can still be a bad trade if the price you'd actually get filled at has slipped too far from the quote.

Parameters

  • RVIPeriod (default 10) — the lookback window used to smooth the close-open/high-low ratio into RVI's main line. A shorter period reacts faster and produces more crosses; a longer period smooths further and lags more, the same trade-off as shortening or lengthening the %K period in a Stochastic-based EA.
  • ATRPeriod (default 14) — the lookback period used to calculate ATR for the Stop Loss distance.
  • ATRMultiplier (default 2.0) — Stop Loss distance = ATR × this multiplier.
  • RiskRewardRatio (default 2.0) — Take Profit distance = Stop Loss distance × this ratio.
  • RiskPercent (default 1.0) — percentage of account balance risked per trade, used to calculate lot size. Ignored if UseFixedLot is enabled.
  • UseFixedLot / FixedLotSize — switches from risk-based sizing to a constant lot size, for traders who prefer a fixed position size regardless of stop distance.
  • MaxSpreadPoints (default 30) — skips new entries while the spread is wider than this, to avoid opening trades at a bad price during illiquid conditions.
  • EnableTrading — a master on/off switch, useful for pausing the EA without removing it from the chart.
  • MagicNumber (default 20260734) — tags every order this EA places, so its position-counting logic never touches trades opened manually or by a different EA on the same account.

RVI Cross vs Stochastic Cross: Same Signal Shape, Different Meaning

This EA and the site's Stochastic crossover EA look almost identical from the outside — both watch two oscillating lines and act the instant the fast one crosses the slow one — and that resemblance is deliberate to read, but the two crosses mean genuinely different things under the hood. Stochastic's %K asks where the current close sits within a recent high-low range; a %K/%D cross is a statement about price's position relative to its own recent history. RVI's main line asks how convincingly the current candle closed away from its own open relative to its own range; an RVI cross is a statement about conviction within the candles themselves, independent of where those candles sit in any longer lookback window.

That difference shows up most clearly in trending markets. Stochastic can pin near an extreme for an entire strong trend, which is why the Stochastic EA on this site only trades crosses that happen inside its Overbought/Oversold zones — filtering out the crosses that happen mid-range, where a reversal is least likely. RVI has no equivalent bounded range to pin against, so it has no equivalent zone filter, and every cross this EA sees is treated as tradable regardless of how far price has already run. That makes this EA's signal count higher in a persistent trend than the zone-filtered Stochastic EA's, but it also means more of those signals are counter-trend noise — a strong uptrend can still produce a run of small pullback candles that dip RVI's main line back under its signal line without the uptrend actually ending, and this EA will act on that dip exactly as readily as it acts on a genuine reversal. Neither design is strictly better; they're different trade-offs between simplicity and selectivity, and it's worth reading both lessons before deciding which cross-based approach fits a given pair's typical behavior.

Installation and Setup

EAs install into a different folder than indicators — this is the step people miss most often.

  1. Download the file below for your platform.
  2. Open MetaTrader → click FileOpen Data Folder.
  3. Place the file in MQL4/Experts (MetaTrader 4) or MQL5/Experts (MetaTrader 5) — not the Indicators folder.
  4. Restart MetaTrader, then drag the EA from the Navigator window onto a chart.
  5. Enable AutoTrading (MT4) or Algo Trading (MT5) in the toolbar — the EA will not place any trades while this is off, even if it's attached to a chart.
  6. Review and adjust the input parameters in the EA's settings dialog before confirming.

A Word of Caution

Test on a demo account first, across different market conditions, before risking real money — past performance, in backtests or live, never guarantees future results. No strategy, automated or manual, wins every trade, and this EA can and will lose money on individual trades. Main/signal-cross EAs like this one are especially prone to whipsaw in choppy, sideways markets: when price has no real direction, the two lines drift close together and cross back and forth repeatedly with no meaningful move behind any single cross, generating a steady drip of small losing trades with nothing in the code to sit those stretches out. This EA has no trend filter built in, so consider pairing it with a read of trend vs range before enabling it on a pair that's clearly rangebound, or layering in your own trend-direction filter (a higher-timeframe moving average, for instance) before it takes a signal. Both files are source code — open and review them fully, and understand what every parameter does, before using it. This content is general education, not personalized investment advice.

Download the EA

How to Install — MetaTrader 4

  1. Download the rvi-signal-cross-ea.mq4 file below.
  2. Open MetaTrader 4 → click FileOpen Data Folder.
  3. Place the file in the MQL4/Experts folder.
  4. Restart MetaTrader 4, then drag the EA from the Navigator window onto the chart.

How to Install — MetaTrader 5

  1. Download the rvi-signal-cross-ea.mq5 file below.
  2. Open MetaTrader 5 → click FileOpen Data Folder.
  3. Place the file in the MQL5/Experts folder.
  4. Restart MetaTrader 5, then drag the EA 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.

Download rvi-signal-cross-ea.mq4

For MetaTrader 4 — this is source code (.mq4), open and review it fully before using it.

Download File

Download rvi-signal-cross-ea.mq5

For MetaTrader 5 — this is source code (.mq5), open and review it fully before using it.

Download File