Statistical Arbitrage AI
- Experts
- 버전: 2.0
- 활성화: 5
StatArb Basket: Statistical Arbitrage EA for MetaTrader 5
Market-neutral pairs trading on forex and commodities.
StatArb Basket trades the relationship between two related instruments instead of betting on market direction. When the price gap between a pair stretches unusually far from its recent norm, the EA sells the expensive leg and buys the cheap one, then closes both when the gap returns to normal.
How it works
- Estimates a rolling hedge ratio between the two symbols using regression on log prices.
- Measures the spread as a z-score and enters when it moves beyond your threshold.
- Sizes the second leg so both legs carry matched money exposure, even across different contract sizes (for example gold against silver).
- Exits on mean reversion, a z-score stop, a maximum holding time or a Friday close.
- Trades a basket of pairs at once, with each pair managed independently.
Key features
- Multi-pair basket set up from a single text input, e.g. EURUSD/GBPUSD,XAUUSD/XAGUSD .
- Stability filters: return correlation and an ADF-style stationarity test, so pairs that have stopped moving together are skipped.
- Cost filter: skips trades whose expected profit doesn’t clearly exceed the two-leg spread cost.
- Spread cap per leg, as a percentage of price.
- Risk-based position sizing at the stop level, or fixed lots.
- Trading-hours window, Friday flatten and a daily loss limit that closes everything and halts trading.
- Rollback protection: if the second leg fails, the first is closed. Orphaned legs are cleaned up automatically.
- Works on netting and hedging accounts. On netting accounts, each symbol can appear in only one pair.
Requirements
- MetaTrader 5, with all basket symbols in Market Watch.
- A low-spread broker with forex and metals or oil CFDs.
- Recommended timeframes: H1 or H4.
- Recommended minimum balance: $1,000 or more, since small accounts can’t hedge accurately at minimum lot sizes.
Risk disclosure
Trading leveraged products carries substantial risk. Statistical relationships between instruments can weaken or break without warning, and past performance does not indicate future results. Test on a demo account and in the Strategy Tester before trading live, and only risk capital you can afford to lose.
Pairs to trade on
| Pair | Why they move together | Notes |
|---|---|---|
| AUDUSD / NZDUSD | Similar commodity-driven economies, same region | The classic forex pair and a good first test |
| EURUSD / GBPUSD | Both are dollar-quoted European majors | Very liquid, tight spreads, but correlation shifts with Brexit-type news |
| EURJPY / GBPJPY | Same yen leg, so mostly euro against pound | Higher volatility; watch Bank of Japan events |
| XAUUSD / XAGUSD | Gold and silver are both precious metals | Silver spreads are wide, and small accounts may hit lot-rounding limits |
| XBRUSD / XTIUSD | Brent and WTI are the same commodity in two markets | Symbol names vary (UKOIL/USOIL); avoid the daily roll hours |
A starter basket that avoids overlapping symbols:
EURUSD/GBPUSD,AUDUSD/NZDUSD,EURJPY/GBPJPY,XAUUSD/XAGUSD,XBRUSD/XTIUSD
What to avoid
- Inversely correlated pairs like EURUSD/USDCHF. The EA rejects negative hedge ratios.
- Triangular sets like EURUSD/GBPUSD/EURGBP, because the legs are mathematically linked.
- Exotics and thin pairs, where spread costs swallow the edge.
- Any pair that keeps failing the correlation or ADF filter. That means the link isn’t stable right now.
I can’t promise any of these will be profitable, so check each one in the Strategy Tester with your broker’s data before using it. This is general information and not financial advice.
