Blog / Strategy
Strategy

Triangular Parity 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?

Triangular Parity Arbitrage is a statistical mean-reversion Expert Advisor (EA) that trades foreign-exchange cross pairs — currency pairs that do not include the US dollar, such as EURGBP, EURJPY, GBPJPY, AUDNZD, or EURCHF. Its core tool is a rolling z-score (a statistical measure of how far a value sits from its recent average, expressed in standard deviations) applied to the price gap between a cross rate and the "fair" price implied by that cross's two US-dollar legs. In plain terms, it is a relative-value strategy that watches a triangle of related exchange rates and reacts when one corner drifts out of line.

The idea comes from classic triangular arbitrage. A cross such as EURGBP is not an independent price — it is mechanically linked to EURUSD and GBPUSD through the dollar: EURGBP should equal (EUR value in USD) divided by (GBP value in USD). Because all three prices are quoted by separate order books, small latency and liquidity gaps can push the actual cross slightly away from this synthetic parity value. Those dislocations tend to be transient, because the triangle must eventually re-close. This EA is designed to study and trade that tendency for the mispricing to mean-revert — to snap back toward parity.

As a learning tool, this strategy suits traders who want to understand statistical arbitrage, z-score standardisation, and multi-symbol relationships in FX. It is a strategy analysis intended to illustrate how dislocations between correlated instruments can be measured and faded — not a shortcut to results. It is best explored on liquid crosses on lower timeframes (M1 to M15), where the underlying USD legs are deep and the parity relationship is tightest.

How It Works

The EA acts once per newly-closed bar on the chart's timeframe. On each new bar it reads three synchronised closing prices — the cross itself and its two USD legs — then builds a fair "synthetic" cross price and measures how far the real price has drifted from it.

Importantly, if either USD leg is unavailable to the platform, or the chart symbol is a USD major rather than a genuine cross, the EA stands aside and does not trade.

triangular parity arbitrage EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
Lookback 120 30 400 Rolling window, in bars, used to compute the mean and standard deviation of the parity deviation for the z-score.
EntryZ 2.0 1.0 4.0 The z-score threshold required to open a fade of the mispricing. Higher values demand a larger dislocation.
ExitZ 0.5 0.0 2.0 Closes the position once the absolute z-score falls back to this level (parity considered restored).
MinEdgeBp 1.0 0.0 15.0 Minimum raw mispricing, in basis points beyond the rolling mean, required before an entry is considered.
AtrPeriod 14 5 40 Number of bars used to calculate the ATR that sizes the stop and target.
AtrStopMult 2.0 0.5 5.0 Protective stop distance as a multiple of ATR.
AtrTargetMult 3.0 0.5 8.0 Profit target distance as a multiple of ATR.
MaxSpreadPoints 60 5 300 Maximum cross spread (in points) allowed for a new entry; wider spreads block entries.
MaxHoldBars 200 0 2000 Hard time stop in bars (0 disables it) so trades are not held indefinitely.
Lots 0.10 0.01 1.0 Trade volume in lots.
Magic 5127 0 9,999,999 Magic number used to identify and manage this EA's own positions.
triangular parity arbitrage EA — MQL5 source code

Recommended Chart Settings

Triangular Parity Arbitrage is designed for liquid non-USD FX crosses — for example EURGBP, EURJPY, GBPJPY, AUDNZD, EURCHF, or AUDJPY — on lower timeframes from M1 to M15, where the two USD legs trade deeply and the parity relationship is tightest. The EA uses whatever timeframe is selected on the chart at run time. It requires the two underlying USD pairs to be available in the platform; if they are not, it safely stands aside. Because market microstructure, spreads, and liquidity differ between brokers and change over time, results will vary across different market conditions, symbols, and account types. Always test on the specific symbol and timeframe you intend to study.

How to Install on MetaTrader 5

What to Consider Before Using This EA

This approach has some genuine conceptual strengths. It is grounded in a real, well-understood market relationship — the arithmetic link between a cross and its two dollar legs — rather than a purely curve-fitted pattern. Its signals are volatility-aware through ATR-based stops and targets, it filters out noise with the basis-point edge and z-score thresholds, and it avoids expensive fills with a spread filter. The convergence exit and time stop give each trade a defined lifecycle.

There are equally important limitations to understand. Statistical arbitrage assumes dislocations revert, but a gap can widen before it closes — or reflect a genuine structural shift rather than transient noise, in which case the position may hit its stop. The parity calculation depends on clean, synchronised data from three symbols; missing or lagging leg data, or a broker symbol suffix the parser does not expect, can cause the EA to stand aside or misjudge the gap. Very tight "true" arbitrage edges are usually captured by faster participants, so on a bar engine the tradable edge is the residual, noisier drift — which is why the strategy fades statistical deviations rather than instant riskless gaps. Performance may weaken in fast-trending regimes, around high-impact news, during illiquid sessions, or when spreads widen and swallow the modest edge. Treat it as an educational study of relative-value mechanics, not a finished system.

Risk Management Tips

Sound risk management matters more than any single parameter. Consider these general principles as you study this EA:

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