Blog / Strategy
Strategy

Basis Convergence Arbitrage

Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.

What Is This Strategy?

Basis Convergence Arbitrage is a single-instrument statistical arbitrage system built around an Exponential Moving Average (EMA) fair-value anchor and a z-score mean-reversion filter. Traditional arbitrage trades the spread between two related prices and collects the difference when that spread snaps back to fair value. Because this strategy runs on one symbol and one timeframe, it cannot compare two separate instruments — so instead it arbitrages a temporal spread: the gap between the current price and its own synthetic equilibrium.

The core idea is straightforward. The strategy calculates a fair-value line as an EMA of the closing price (a moving average that weights recent prices more heavily than older ones). It then measures the basis — the distance between the latest close and that fair-value line. This basis behaves much like an arbitrage spread: it drifts away from zero, then tends to be pulled back toward it. To make that drift comparable across calm and volatile markets, the basis is standardised into a z-score, which expresses how many standard deviations the current basis sits from its recent average.

This is a mean-reversion trading style, so it is best suited as a learning tool for studying range-bound, oscillating markets rather than strong, one-directional trends. It is designed for traders who want to understand how stationarity, standardisation, and regime filtering combine in a disciplined statistical-arbitrage framework. The natural home is a liquid, range-prone FX major such as EUR/USD on intraday charts, though it can be tested on any symbol and timeframe. Treat it as a study of convergence behaviour, not as a shortcut to returns.

How It Works

The strategy evaluates its rules only once per freshly closed bar, so signals are based on completed price action rather than a flickering, still-forming candle. Here is what happens on each closed bar:

Two robustness gates decide whether a dislocation is genuinely tradable — this is what keeps the approach disciplined:

Entry conditions the strategy signals:

Exit logic:

Only one position per magic number is held at a time, and a spread filter (MaxSpreadPoints) blocks new entries when transaction costs are unusually wide.

basis convergence arbitrage MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
AnchorPeriod 50 20 150 EMA lookback used to build the fair-value equilibrium the basis is measured against.
BasisWindow 60 20 150 Rolling window for the mean and standard deviation that standardise the basis into a z-score.
EntryZ 2.0 1.0 3.5 Enter when the standardised basis is at least this many standard deviations from its mean.
ExitZ 0.4 0.0 1.5 Exit (convergence realised) once the basis pulls back inside this z-band.
SlopeLookback 20 5 60 Number of bars used to measure the anchor's slope for the flat-regime gate.
MaxSlopeAtr 0.12 0.02 0.60 Maximum anchor slope-per-bar (× ATR) still allowed to call the regime "flat/reverting".
AtrPeriod 14 5 30 ATR lookback used for the regime gate and the hard stops.
StopAtrMult 2.0 0.8 5.0 Hard stop-loss distance as a multiple of ATR.
TpAtrMult 1.5 0.5 4.0 Take-profit distance as a multiple of ATR.
MaxSpreadPoints 80 5 300 Skip new entries when the current spread (in points) is wider than this.
Lots 0.10 0.01 1.0 Fixed order volume per trade.
Magic 48213 0 9,999,999 Magic number used to identify and manage this EA's positions.
basis convergence arbitrage MT5 EA — MQL5 source code

Recommended Chart Settings

This strategy was designed with a liquid, range-prone FX major such as EUR/USD in mind, on intraday timeframes roughly in the M5 to M30 range, where mean-reversion behaviour tends to be more pronounced than on higher timeframes. Because every component self-scales — the z-score adapts to volatility, and the regime gate and stops adapt via ATR — the logic will technically run on whatever symbol and timeframe you attach it to. That flexibility is not a promise of consistency: results will vary considerably across instruments, sessions, and market conditions, so always test on your specific chart before drawing conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

The main strength of this approach is discipline. Mean-reversion systems are notorious for entering too early and holding through relentless one-way moves; the flat-regime gate and turn confirmation are explicit attempts to avoid exactly that, and the z-score standardisation keeps the entry threshold consistent whether the market is quiet or wild. The ATR-based stop and take-profit add hard safety rails so that a broken relationship does not turn into an open-ended loss.

The known limitations are equally important to understand. Mean-reversion strategies structurally struggle in trending or breakout regimes — the very conditions where a spread refuses to converge. The flat-regime gate reduces but cannot eliminate this risk, because a range can transition into a trend after a position is already open. Statistical relationships also drift over time, so parameters that fit one period may not fit the next. And because entries wait for convergence to begin, the strategy will inevitably miss dislocations that reverse sharply without a confirming turn. This is a framework for studying convergence dynamics, not a set-and-forget solution. Test it thoroughly, and judge it by how well you understand its behaviour, not by any single run.

Risk Management Tips

Sound risk management matters far more than any single indicator setting. Consider these general principles as you study this strategy:

Risk Warning

Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.

Downloads

← Back to Blog