Skip to content

Free MT5 Expert Advisor

Vortex Trend EA

MT5 Expert Advisor that trades VI+ / VI- crossovers of the Vortex Indicator, with an ATR stop-loss, R-multiple target and risk-% sizing.

Trendv1.0MetaTrader 5 (MQL5) Compiles with 0 errors Non-repainting signals Stop-loss on every trade
Strategy
Buys when VI+ crosses above VI- on a closed bar and sells when VI- crosses above VI+. The stop is 1.5 x ATR and the target is 2R.
Risk model
1% of balance per trade (configurable), stop-loss on every order, one position at a time

What it does

The Vortex Indicator compares upward and downward price movement between consecutive bars. Its two lines, VI+ and VI-, cross when the balance between buying and selling pressure shifts. This EA trades those crossovers.

Trades are protected by an ATR-based stop-loss with a reward-to-risk target, and each position is sized from the stop distance and your chosen risk percentage.

How it works

The Vortex lines are calculated inside the EA from the last closed bars:

  • Positive movement = |today's high - yesterday's low|. Negative movement = |today's low - yesterday's high|.
  • True range = the larger of today's high and yesterday's close minus the smaller of today's low and yesterday's close.
  • VI+ = sum of positive movement over 14 bars ÷ sum of true range; VI- = sum of negative movement ÷ sum of true range.
  • Buy: VI+ is above VI- on the last closed bar and was at or below it on the bar before.
  • Sell: the mirror image.
  • Optional gap filter: if set above 0, the lines must be at least that far apart after the cross.
  • Stop-loss: 1.5 x ATR(14). Target: 2R. Exit: by default the position closes on the opposite cross.

How to use it

Vortex crossovers are frequent, so the EA suits trending markets on H1 and H4 where crossovers are followed by sustained moves. A small gap filter, such as 0.05, removes some marginal crosses where the lines barely separate.

To judge whether the fixed 2R target suits the symbol, review the risk-reward ratio lesson and compare it with how far typical swings travel.

Settings

InputDefaultWhat it changes
Vortex period14Bars summed for the Vortex calculation.
Minimum VI gap0.0Required distance between the lines after the cross (0 = off).
Stop-loss distance (x ATR)1.5Stop distance as a multiple of ATR(14).
Take-profit (R multiple)2.0Target as a multiple of the stop distance.
Exit on opposite crosstrueCloses the trade on the opposite Vortex cross.
Risk per trade (% of balance)1.0Share of balance risked between entry and stop.
Fixed lots0Fixed volume instead of risk %; 0 = risk-based.
Maximum spread (points)20Skips signals when the spread is wider; 0 = off.
Trading start / end hour7 / 20Server-time window for new trades; equal values = 24 hours.
Move stop to break-eventrueStop to entry + 20 points once profit reaches 1R.
Use trailing stopfalseTrails the stop 2 x ATR behind price.
Magic number2611013Identifies this EA's trades.

Limitations

  • Crossovers lag turning points and can come in clusters in sideways markets.
  • There is no separate trend filter; the EA trades both directions on every cross.
  • The gap filter is in indicator units, so a value that suits one symbol may not suit another.
  • Gaps between sessions inflate true range and affect the lines for the next 14 bars.

Before you run it live

Test on a demo account and in the MetaTrader 5 Strategy Tester over several years first. No backtest results are published for this EA, and any test describes the past only.

  • Match the spread limit and trading hours to your broker's spreads, stop level and session times, and include commission and swap in tests.
  • Start with 1% risk or less and check the lot sizes in the Experts log; the Position Size Calculator is a useful cross-check.
  • Use a different magic number on each chart, and keep the terminal (or a VPS) running so stops are managed.

Test on more than one symbol before relying on the defaults, as Vortex behavior varies with each market's volatility.

Key inputs

Key inputs of Vortex Trend EA
InputDefaultDescription
Vortex period14Bars summed for the Vortex calculation.
Minimum VI gap0.0Required distance between the lines after the cross (0 = off).
Stop-loss distance (x ATR)1.5Stop distance as a multiple of ATR(14).
Take-profit (R multiple)2.0Target as a multiple of the stop distance.
Exit on opposite crosstrueCloses the trade on the opposite Vortex cross.
Risk per trade (% of balance)1.0Share of balance risked between entry and stop.

Educational tools, not advice. Automated trading can lose money quickly. Indicators and Expert Advisors describe price; they do not predict it, and past behaviour does not guarantee future results. Test everything on a demo account first and never risk money you cannot afford to lose. See our disclaimer.

Keep exploring

Related mt5 expert advisors