EA-955 · Statistical Arbitrage

BeeLine

This EA implements a pairs trading / statistical arbitrage strategy between two correlated currency pairs (e.g., EURUSD and GBPUSD). It measures the price deviation between a base and an indirect instrument using a compaction-normalized spread, opening hedged positions when deviation exceeds a dynamic signal border and closing when the spread reverts. Periodic re-optimization calibrates the relationship parameters from a rolling historical window.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskElevated
Rating★★★☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsPrice Spread, Historical High/Low Range, Compaction Coefficient
AuthorEvgeniy Trofimov

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD0.00%0.00%0.00%0—————Not convertible yet
GBPUSD0.00%0.00%0.00%0—————Not convertible yet
USDJPY0.00%0.00%0.00%0—————Not convertible yet
XAUUSD0.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: Elevated

  • Has no stop loss or trailing stop
  • Can hold up to 3 positions at once

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 strategy is pairs trading within statistical arbitrage: it selects two correlated currency pairs and calculates a compaction coefficient from their historical price ranges, normalizing the indirect instrument's price onto the base instrument's price scale, then computing the deviation between them. Entry conditions require the absolute current deviation to exceed the dynamic signal border (MaxDeviation) and the current deviation to be larger than the previous bar's deviation (indicating divergence is expanding), at which point hedged positions are opened on both instruments based on deviation direction and correlation sign. Exit conditions are threefold: first, spread crossover reversion (deviation direction opposite to position direction); second, deviation shrinks below CloseCorr ratio of the signal border while the position is profitable; third, total profit reaches Profit percentage of account balance. Position sizing calculates the base instrument lot from the deviation multiple and existing positions, while the indirect instrument lot is converted and normalized using the compaction coefficient and tick value ratio. Money management supports both fixed lot and equity-proportional modes, with normalization for minimum/maximum lot sizes and lot step increments.

Strengths

  • Complete statistical arbitrage logic based on spread mean reversion, with solid statistical foundation
  • Supports both positive and negative correlation between currency pairs, offering high flexibility
  • Highly parameterized with adjustable signal border, close coefficient, and optimization interval to adapt to different market conditions

Weaknesses

  • No stop-loss mechanism; if the spread diverges persistently without reverting, catastrophic losses are possible
  • Compaction coefficient and signal border are calculated from a historical window, which may fail when market structure shifts abruptly
  • Contains time-based protection code (randomizing signals after September 2011), which intentionally limits strategy reliability in live trading

Possible improvements

  • Add hard stop-loss and maximum drawdown limits to prevent excessive single-trade losses
  • Add spread stability detection and market regime filters to avoid trading during structural regime changes

Risk assessment

Overall risk: Medium

  • No stop-loss mechanism means unlimited losses if spread divergence persists
  • Time-based protection code randomizes trade signals after a specific date, causing unpredictable behavior
  • Position accumulation mechanism (MaxDeals=3) may build excessively large positions during sustained divergence

Evaluation scores

Code quality3.0
Strategy logic4.0
Risk management2.0
Robustness2.0
Innovation4.0
Documentation2.0
Overall2.8

Parameters

ParameterDefaultDescription
Symbol2GBPUSDIndirect instrument (second currency pair in the pair)
CrossCross currency pair replacing two-pair trading
CrossTypetrueDirect cross rate flag
MagicNumber1004EA unique identifier number
Range640Training window (number of historical bars)
Profit3Max profit percentage (relative to account balance)
CorrectLimit0.70Signal boundary correction coefficient
CorrectDist1.20Length coefficient for max deviation search
Optimum120Re-optimization interval (number of bars)
MaxDeals3Max number of trades (position additions)
CloseCorr0.618034Deviation reduction closing coefficient (golden ratio)
Correlation1Correlation coefficient (1=positive, -1=negative)
LOT0.02Lot size
LOT_TYPE1Lot type: 0=fixed, 1=equity proportion

Similar Statistical Arbitrage EAs

Backtests are historical simulations and do not guarantee future results. Not financial advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.