An indicator only plots a line or fires an alert — an Expert Advisor (EA) actually sends orders on your behalf. This free EA trades the Vortex Indicator's VI+/VI− crossover directly: the moment directional pressure flips from one side to the other, it opens a trade in that direction, with Stop Loss, Take Profit, and position size all calculated automatically from ATR and account risk.
How the Strategy Works
The entry signal is the Vortex crossover itself: VI+ crossing above VI− signals buyers have taken directional control and triggers a BUY; VI− crossing above VI+ signals sellers have taken control and triggers a SELL. Both lines are calculated internally by the EA using the same method covered in the Vortex Indicator lesson — summed directional movement (VM+/VM−) divided by summed True Range over a period — since there's no built-in Vortex function in either MetaTrader 4 or MetaTrader 5 for the EA to call.
This EA deliberately does not layer a trend-strength filter on top of the raw crossover, unlike this site's ADX Trend Strength EA, which only acts on a +DI/-DI cross once ADX confirms a strong trend. The Vortex Indicator has no equivalent built-in strength reading to filter on, so this EA trades the crossover in its purest form — faster and more frequent than a filtered trend-following signal, at the cost of also catching more short-lived, choppy shifts that don't develop into a sustained move. That trade-off is the entire design premise of this EA, covered in more detail below.
Stop Loss, Take Profit, and Position Sizing
Both Stop Loss and Take Profit are sized from ATR rather than a fixed pip distance, so the stop always reflects how much the pair is actually moving right now. Stop Loss distance is ATRMultiplier × ATR (default multiplier 2.0, ATR calculated over ATRPeriod, default 14), and Take Profit is then set at RiskRewardRatio × Stop Loss distance (default 2.0) — every trade this EA opens, on any pair or timeframe, carries the same fixed reward-to-risk proportion.
Position size follows the exact worked-example method from Risk Management Basics: RiskPercent (default 1.0%) of account balance is divided by the Stop Loss distance to produce a lot size, keeping the dollar amount at risk roughly constant even as the ATR-based stop distance changes with volatility. See Lot Sizes Explained for how this lot size is then normalized to the broker's minimum, maximum, and step lot size before the order is sent. UseFixedLot is available as an escape hatch for a constant lot size regardless of account risk.
Entry Conditions
- BUY — VI+ crosses above VI− on the just-closed bar (VI+ was at or below VI− the bar before, and is now above it).
- SELL — VI− crosses above VI+ on the just-closed bar — the mirrored condition.
Three safety mechanics govern every trade this EA can place, matching the standard used across every EA on this site: it evaluates entry conditions once per new bar only, tracked via the bar's open time, so a single qualifying bar can't trigger repeated entries within the same candle; it opens only one position at a time, checked by counting open trades filtered to this EA's own symbol and magic number before any new entry is considered; and it checks the current spread against MaxSpreadPoints (default 30) before sending an order, skipping the entry if the spread is too wide to trade at a reasonable price. Every order is tagged with MagicNumber (default 20260724), so the EA's position-counting logic never touches a trade opened manually or placed by a different EA running on the same account.
Parameters
- VortexPeriod (default 14) — the lookback window
VM+,VM−, and True Range are summed over before dividing to produce VI+ and VI−. A shorter period produces faster, more frequent crossovers; a longer period smooths the lines and reduces false signals at the cost of reacting later. - 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
UseFixedLotis enabled. - RiskPercent (default 1.0) — percentage of account balance risked per trade when
UseFixedLotis disabled. - MaxSpreadPoints (default 30) — skips new entries while the spread is wider than this.
- MagicNumber (default 20260724) — 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 This EA Trades the Raw Crossover Without a Trend-Strength Filter
Several EAs on this site — the ADX Trend Strength EA most directly — pair a directional crossover with a separate strength reading, only acting on the cross once that strength reading confirms a genuine trend is underway. This EA deliberately doesn't do that, and it's worth explaining why rather than treating it as an oversight. The Vortex Indicator doesn't produce an equivalent standalone strength value the way ADX does; VI+ and VI− only describe which side currently has directional control, not how convincingly. Bolting on an unrelated strength filter (borrowing ADX for this purpose, for instance) is possible but changes what this EA actually is — at that point it's no longer testing the Vortex crossover on its own merits, it's testing a combined system.
Trading the raw crossover instead means accepting the trade-off in full: faster reaction to genuine directional shifts, and more false signals during choppy, range-bound conditions where VI+ and VI− cross back and forth without either side gaining sustained control. This is a deliberate design choice suited to traders who want to evaluate the Vortex Indicator's signal quality directly, or who plan to add their own filter on top through additional inputs — not a claim that an unfiltered crossover is the optimal way to trade Vortex in every market condition.
Installation and Setup
EAs install into a different folder than indicators, and this is the step people miss most often.
- Download the file below for your platform.
- Open MetaTrader → click
File→Open Data Folder. - Place the file in
MQL4/Experts(MetaTrader 4) orMQL5/Experts(MetaTrader 5) — not the Indicators folder. - Restart MetaTrader, then drag the EA from the Navigator window onto a chart.
- 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.
- 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 and multiple pairs, before risking real money — a good backtest or demo run never guarantees future results. This EA can and will lose on individual trades, and because it trades the raw Vortex crossover without a trend-strength filter, it is especially prone to a cluster of losses during choppy, range-bound conditions where VI+ and VI− whipsaw back and forth. Consider combining this EA with a trend filter or higher-timeframe bias check — see Trend vs Range — rather than running it unfiltered through every market condition. Both the MT4 and MT5 files below are source code — open and read them fully, and understand exactly what every parameter does, before attaching this EA to a live account. This content is general education, not personalized investment advice.
Download the EA
How to Install — MetaTrader 4
- Download the
vortex-crossover-ea.mq4file below. - Open MetaTrader 4 → click
File→Open Data Folder. - Place the file in the
MQL4/Expertsfolder. - Restart MetaTrader 4, then drag the EA from the Navigator window onto the chart.
How to Install — MetaTrader 5
- Download the
vortex-crossover-ea.mq5file below. - Open MetaTrader 5 → click
File→Open Data Folder. - Place the file in the
MQL5/Expertsfolder. - 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.