2-Pair Correlation EA
This EA trades two currency pairs based on their statistical correlation, opening opposing positions when the pairs diverge from their historical correlation relationship and closing when correlation normalizes. It exploits temporary mispricing between correlated instruments using a pairs trading approach. The strategy assumes mean reversion of the correlation spread between the two selected symbols.
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
- Can hold up to 2 positions at once
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
This EA employs a statistical arbitrage/pairs trading strategy, with the core concept that price divergence between two highly correlated currency pairs will eventually revert to the mean. Entry conditions trigger when the spread or correlation between the two pairs deviates beyond a configured threshold from historical norms, opening a long position on one pair and a short position on the other to hedge directional market risk. Exit conditions close both positions when the correlation normalizes or the spread converges, capturing the reversion profit, with stop-losses potentially set for when divergence continues to widen. Position sizing typically adjusts lot sizes based on the volatility ratio and pip value differences between the two instruments to ensure equal monetary exposure on both sides. Money management may use fixed lots or balance-proportional sizing, while the pair trading structure inherently provides market-neutral characteristics that reduce directional risk. The overall strategy relies on the stability assumption of correlation, which can face significant drawdown during structural market regime changes.
Strengths
- Market-neutral strategy that hedges directional risk, capable of profiting in both rising and falling markets
- Trading based on statistical relationships provides mathematical and empirical foundation
- Pairs trading inherently limits directional exposure, making drawdowns relatively more controlled
Weaknesses
- Relies on correlation stability assumption; correlation breakdowns during structural market shifts can cause severe losses
- Different pip values, volatility, and trading sessions between the two instruments can result in imperfect hedging
- Requires simultaneously managing orders on two symbols, increasing execution risk and slippage costs
Possible improvements
- Add dynamic correlation monitoring with adaptive threshold adjustment, automatically reducing position size or pausing trading when correlation weakens
- Replace simple correlation analysis with cointegration testing to more accurately assess the mean-reversion property of the spread
Risk assessment
Overall risk: Medium
- Correlation breakdown risk: Black swan events or structural market changes can cause correlation to suddenly vanish, invalidating the hedge and producing losses on both sides
- Execution risk: Inability to fill both symbols' orders simultaneously can create hedge gaps, especially during low liquidity conditions
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Symbol1 | EURUSD | First trading symbol |
Symbol2 | GBPUSD | Second trading symbol |
CorrelationPeriod | 100 | Correlation calculation period |
EntryThreshold | 2.0 | Entry deviation threshold in standard deviations |
ExitThreshold | 0.5 | Mean reversion exit threshold |
LotSize | 0.1 | Base trading lot size |
StopLoss | 500 | Stop loss in points |
MagicNumber | 52043 | Magic number filter for order selection |
Similar Statistical Arbitrage EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.