- 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
| Input | Default | What it changes |
|---|---|---|
| Vortex period | 14 | Bars summed for the Vortex calculation. |
| Minimum VI gap | 0.0 | Required distance between the lines after the cross (0 = off). |
| Stop-loss distance (x ATR) | 1.5 | Stop distance as a multiple of ATR(14). |
| Take-profit (R multiple) | 2.0 | Target as a multiple of the stop distance. |
| Exit on opposite cross | true | Closes the trade on the opposite Vortex cross. |
| Risk per trade (% of balance) | 1.0 | Share of balance risked between entry and stop. |
| Fixed lots | 0 | Fixed volume instead of risk %; 0 = risk-based. |
| Maximum spread (points) | 20 | Skips signals when the spread is wider; 0 = off. |
| Trading start / end hour | 7 / 20 | Server-time window for new trades; equal values = 24 hours. |
| Move stop to break-even | true | Stop to entry + 20 points once profit reaches 1R. |
| Use trailing stop | false | Trails the stop 2 x ATR behind price. |
| Magic number | 2611013 | Identifies 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.

