Triangular Arbitrage
This EA implements triangular arbitrage, a market-neutral strategy that exploits price discrepancies between three currency pairs that form a closed loop (e.g., EUR/USD, GBP/USD, EUR/GBP). It continuously monitors bid/ask prices across the three pairs and executes simultaneous trades when a pricing inefficiency exceeds a configurable threshold, aiming to capture risk-free profit from the spread differential.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Blow-up risk: No blow-up pattern found
- Has no stop loss or trailing stop
On its own this is not a typical blow-up pattern, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
The core concept of triangular arbitrage is to exploit pricing inconsistencies among three correlated currency pairs to achieve near-risk-free profit. Entry conditions trigger when the deviation between the synthetic cross rate (calculated from the two legs) and the direct quote exceeds a configurable threshold that accounts for trading costs and spreads. The EA simultaneously buys the undervalued pair and sells the overvalued pair, executing all three legs as close together in time as possible. Exit conditions are met when the arbitrage spread converges to zero or falls below a minimum profit target, or when a maximum holding period is exceeded to prevent prolonged exposure. Position sizing typically uses fixed lots or dynamically adjusts based on the magnitude of the arbitrage opportunity, with all three trade volumes precisely matched to maintain market neutrality. Money management requires a strict net-profit threshold filter because the theoretical risk-free nature is eroded in practice by slippage, execution latency, and variable spreads. The strategy demands extremely fast execution, as millisecond-level delays can cause the arbitrage window to vanish before all three legs are filled.
Strengths
- Theoretically market-neutral — profits do not depend on market direction, making it resilient in both trending and ranging environments
- Arbitrage opportunities increase during volatile periods, providing natural complementarity to trend-following strategies
- Clear logic with well-defined profit expectations per trade cycle, making risk assessment straightforward
- No reliance on technical indicators for direction, eliminating emotional bias from discretionary signal interpretation
Weaknesses
- Arbitrage windows are extremely fleeting — highly sensitive to execution latency, making implementation difficult on standard retail platforms
- Slippage and variable spreads can completely erode theoretical profits, resulting in actual net returns far below backtest projections
- All three legs must fill nearly simultaneously; a partial fill on one leg creates unwanted directional exposure
- Retail brokers typically discourage arbitrage activity and may restrict accounts, widen spreads, or introduce execution delays
Possible improvements
- Add order execution monitoring with automatic hedging or closure of remaining positions when one leg fails to fill
- Implement dynamic spread and latency estimation to adjust the minimum profit threshold in real-time based on market conditions
- Integrate WebSocket or faster price feed mechanisms to reduce price detection latency
Risk assessment
Overall risk: Caution
- Partial fill risk across three legs — failure to fill one leg creates unwanted directional exposure
- Execution latency risk — the arbitrage window may close between order submission and execution
- Broker risk — retail brokers may counter arbitrage through requotes, widened spreads, or trade restrictions
- Spread volatility risk — actual spreads at execution may differ from expected, leading to losses
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Symbol1 | EURUSD | Triangular arbitrage first currency pair |
Symbol2 | GBPUSD | Triangular arbitrage second currency pair |
Symbol3 | EURGBP | Triangular arbitrage third currency pair (cross pair) |
MinProfitPips | 2 | Minimum arbitrage profit threshold (pips) |
Lots | 0.1 | Lot size per trade |
MaxHoldSeconds | 60 | Maximum holding time (seconds) |
Slippage | 3 | Maximum allowed slippage in points |
MagicNumber | 12345 | EA magic number for order identification |
Similar Statistical Arbitrage EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.