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
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: 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
Parameters
| Parameter | Default | Description |
|---|---|---|
Symbol2 | GBPUSD | Indirect instrument (second currency pair in the pair) |
Cross | Cross currency pair replacing two-pair trading | |
CrossType | true | Direct cross rate flag |
MagicNumber | 1004 | EA unique identifier number |
Range | 640 | Training window (number of historical bars) |
Profit | 3 | Max profit percentage (relative to account balance) |
CorrectLimit | 0.70 | Signal boundary correction coefficient |
CorrectDist | 1.20 | Length coefficient for max deviation search |
Optimum | 120 | Re-optimization interval (number of bars) |
MaxDeals | 3 | Max number of trades (position additions) |
CloseCorr | 0.618034 | Deviation reduction closing coefficient (golden ratio) |
Correlation | 1 | Correlation coefficient (1=positive, -1=negative) |
LOT | 0.02 | Lot size |
LOT_TYPE | 1 | Lot type: 0=fixed, 1=equity proportion |
Similar Statistical Arbitrage EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.