Forex
EA

EA: Momentum Cross Expert Advisor

Last updated 2026-07-18

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 around the Momentum indicator's 100 centerline: it enters the moment Momentum crosses back through 100, then manages Stop Loss, Take Profit, and position size automatically from the same risk tools taught elsewhere on this site.

How the Strategy Works

The entry signal is the Momentum indicator's centerline cross — the same 100 level explained in the site's Momentum lesson. Momentum is calculated as the current closing price divided by the closing price MomentumPeriod bars ago, multiplied by 100: a reading above 100 means price is higher now than it was that many bars back (upward momentum), a reading below 100 means price is lower now (downward momentum), and exactly 100 means price is unchanged over the lookback. This EA uses the default MomentumPeriod of 14 bars applied to the close.

What makes Momentum different from RSI or CCI is that it has no universally agreed overbought or oversold zone. RSI has a widely used 70/30 convention, and CCI has ±100, but Momentum's raw output is an unbounded ratio around 100 whose typical range depends entirely on the pair's volatility and the lookback period chosen — there's no fixed number above which "too far" reliably means anything. Because of that, the 100 centerline itself is the entire signal this EA trades: not a level to fade or wait out, but the one place on the whole indicator where the calculation actually changes sign, from price being lower than it was MomentumPeriod bars ago to higher, or the reverse. That's a meaningfully different design decision than trading a zone boundary, and it's why this EA's logic is so short — there's exactly one condition to check, not a zone entry plus a zone exit.

Stop Loss, Take Profit, and Position Sizing

PriceTake Profit (TP)Stop Loss (SL)BUY100Momentum (oscillates around a 100 centerline)
Entry conditions: BUY when Momentum crosses back above 100 — SELL on the mirrored cross back below 100 — 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 chosen once and left unchanged. Stop Loss distance is ATRMultiplier × ATR (default multiplier 2.0, with ATR calculated over ATRPeriod = 14 bars), and Take Profit is then set at RiskRewardRatio × Stop Loss distance (default 2.0), so every trade this EA opens carries a fixed, known reward-to-risk proportion regardless of which pair or timeframe it's trading.

Position size is calculated from RiskPercent (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 = lot size. A wider ATR-based stop on a volatile pair automatically produces a smaller lot, and a tighter stop on a calm pair produces a larger lot, so the dollar risk per trade stays roughly constant even though the price distance to the stop changes trade to trade. A UseFixedLot input is available as an escape hatch for traders who'd rather trade a constant lot size regardless of risk percentage — useful for testing or for small accounts where percentage-based sizing rounds to the broker's minimum lot anyway.

Entry Conditions

  • BUY — Momentum crosses from at-or-below 100 to above 100 on consecutive completed bars: the previous bar's Momentum reading was 100 or lower, and the current bar's reading is above 100.
  • SELL — Momentum crosses from at-or-above 100 to below 100 — the mirrored setup.

Beyond the signal itself, three safety mechanics govern every trade: the EA only evaluates these conditions once per new bar (not on every tick, so a single crossover can't fire multiple trades within the same candle), only opens one position at a time (a new signal is ignored while a position from this EA is already open), and only manages positions tagged with its own magic number (20260731) — so it never touches trades you open manually or trades placed by a different EA running on the same account. A spread filter also sits in front of every entry: if the current spread is wider than MaxSpreadPoints, the EA skips that bar entirely rather than opening a trade at a bad price during illiquid conditions.

Parameters

  • MomentumPeriod (default 14) — the number of bars back the current close is compared against; this is the entire lookback the indicator uses.
  • AppliedPrice (default Close) — the price series Momentum is calculated from.
  • ATRPeriod (default 14) — the lookback used to calculate ATR for Stop Loss sizing.
  • ATRMultiplier (default 2.0) — Stop Loss distance = ATR × this multiplier.
  • RiskRewardRatio (default 2.0) — Take Profit distance = Stop Loss distance × this ratio.
  • UseFixedLot — switches position sizing from risk-based to a constant lot size.
  • FixedLotSize (default 0.01) — the lot size used when UseFixedLot is enabled.
  • RiskPercent (default 1.0) — percentage of account balance risked per trade, used to calculate lot size. Ignored if UseFixedLot is enabled.
  • MaxSpreadPoints (default 30) — skips new entries while the spread is wider than this, to avoid opening trades at a bad price during illiquid conditions.
  • MagicNumber (default 20260731) — tags every order this EA places so its position-management logic never touches trades opened by hand or by a different EA.
  • EnableTrading — a master on/off switch, useful for pausing the EA without removing it from the chart.

Why a Raw Centerline Cross, and How It Compares to Other Momentum EAs

This EA trades every 100-centerline cross exactly as it happens, with no zone confirmation, no minimum distance from 100 required, and no trend filter layered on top. That's worth comparing to the site's other centerline/zero-line-cross EAs, the Awesome Oscillator momentum EA and the MACD momentum EA, because all three trade a crossing-through-a-fixed-level signal but derive it from different math. MACD's cross comes from two exponential moving averages of price crossing a further-smoothed signal line, which builds in some lag and noise filtering. The Awesome Oscillator's zero cross comes from two simple moving averages of the bar's midpoint, with no signal line at all. Momentum's cross is simpler again: it's a direct ratio between today's close and the close MomentumPeriod bars back, with no averaging step anywhere in the calculation. That makes it the most literal of the three, reacting to a genuine price change immediately, but also the most exposed to a single noisy bar flipping the ratio back across 100 before any real move has developed.

That trade-off is sharpest in a quiet, range-bound market. When price drifts sideways, the close MomentumPeriod bars ago and the current close stay nearly equal, so the ratio hovers tightly around 100 and crosses it repeatedly — each cross is a technically valid signal by this EA's rule, but collectively that's a whipsaw pattern that bleeds small losses to spread and slippage on every false entry. This EA therefore tends to perform best in markets that are trending or just breaking out of a range, where a centerline cross reliably marks the start of a real move, and worst in tight, directionless conditions. Checking trend vs range conditions before running this EA on a given pair is the single highest-leverage thing a trader can do to improve its results, even though the EA makes no attempt to detect that condition automatically — it trades the cross wherever and whenever it happens, and adding a moving-average or ADX-based trend filter on top is a natural next customization for anyone comfortable editing the source.

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. Momentum's centerline-cross signal has no built-in filter for choppy conditions: when the oscillator hovers tightly around 100 in a quiet or ranging market, expect a run of false crosses in quick succession, each one a small loss from spread alone. Consider pairing this EA with a trend filter, or only running it on pairs and timeframes you've confirmed are trending, rather than leaving it on every chart in every condition. 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 momentum-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 momentum-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 momentum-cross-ea.mq4

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

Download File

Download momentum-cross-ea.mq5

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

Download File