King Arb Gold Euro
- Experts
- Versione: 2.27
- Aggiornato: 21 giugno 2026
- Attivazioni: 5
King Arb (XAU-EUR) is a market-neutral statistical-arbitrage Expert Advisor for gold (XAUUSD) and the euro (EURUSD). It builds an equal-weight USD common factor from gold, silver and the euro, removes that factor to isolate the idiosyncratic residual of each instrument, and trades the mean-reversion of the cumulative residual gap (zres_XAU minus zres_EUR) on the M15 timeframe. Silver is used only to estimate the common factor and is never traded, which keeps trading costs low. Gold and the euro are held together as a hedged two-leg spread: the EA enters when the residual gap is stretched (long one leg, short the other) and exits as the gap reverts.
Core innovations
- Equal-dollar hedge: both legs carry identical USD notional, removing the translation leak (the residual reverts yet the hedged spread still loses) that undermines lagged-beta hedging.
- Volatility-target sizing: position size is scaled down automatically in high-volatility regimes (de-leverage only), compressing drawdown while preserving return.
- Regime gates: a gold/USD-index directional de-risk and a euro-leg regime gate cut exposure on the side a prevailing trend is pressing against.
- Institutional-grade execution: atomic two-leg entry with automatic rollback if one leg fails, magic-number restart recovery, a free-margin pre-check, a trading-session check and a spread filter.
Verified performance - real ticks
Tickmill MT5 - every tick based on real ticks (model 4) - 10,000 USD - 2025.01 to 2026.06 - commission (6 USD per lot round-turn) and real spreads included:
- Net profit +166.5% - Profit factor 1.37 - Sharpe 5.12 - Win rate 58.9% - Trades 1388
Inputs and parameters
Every parameter ships pre-optimized. Attach the EA to an XAUUSD M15 chart and it runs exactly as tested - no set file required. The inputs are organised into groups:
Symbols
- InpXAU / InpXAG / InpEUR - gold, silver and euro symbol names. Change these only if your broker adds a suffix (for example XAUUSD.m). Silver feeds the factor and is never traded.
Signal (please do not change)
- InpTF (M15), FactorWin, LoadWin, Zwin, EntryZ (2.0), ExitZ (0.6), StopZ (4.0), MaxHoldBars (64), UseFlip. These define the residual z-score signal and the entry / exit / stop levels. They were fixed by walk-forward testing; changing them departs from the validated configuration.
Position and sizing
- LotsXAU (0.10) - gold-leg lot size and the single leverage / return knob. The euro leg is sized automatically from the hedge ratio. Scale LotsXAU linearly to your balance (about 0.10 per 10,000 USD) and start small.
- HedgeConst (1.0) - equal-dollar hedge constant (recommended). Set 0 to use an estimated beta instead.
- AdverseStopPct (1.5) - closes the whole basket if floating loss exceeds this percent of the gold-leg notional (0 = off).
- ShortSizeMult (0.7) - size factor for the short-spread (short-gold) side; below 1 reduces it, 1 is symmetric.
- LongSpreadOnly (false) - set true to trade the long-spread side only. In testing this gives a higher risk-adjusted return and a lower drawdown, at the cost of a mild long-gold tilt.
Regime gates (risk control, on by default)
- UseDxyGate / DxyBasket / DxyThr / DxyWin - de-risk a leg when the broad USD trend (a seven-pair USD-index proxy) opposes the position.
- UseEuroGate / EuroGateWin / EuroGateThr / EuroGateMult - reduce the euro hedge in strong gold trends, where the euro leg is negative carry.
- TrendDeriskMult / TrendDeriskWin / TrendDeriskThr - reduce the side a strong gold trend is pressing against.
- UseVolTarget / VolWin / VolRefWin / VolScaleLo / VolScaleHi - scale position size down in high-volatility periods (de-leverage only).
Execution and filters
- Magic (109222) - order identifier; change it if you run several copies on one account.
- DeviationPts (10) - maximum slippage in points. MaxRetries (3) - order retries per leg.
- MaxSpreadXAU / MaxSpreadEUR - skip new entries when the spread is wider than this (in price).
- EnableTrading (true) - master switch (false computes the signal only). InpVerbose - detailed log. DumpTag - equity export for charting.
How to deploy
1. Use a hedging account.
2. Make these symbols visible in Market Watch with history: XAUUSD, XAGUSD, EURUSD and the USD-index basket (EURUSD, GBPUSD, AUDUSD, NZDUSD, USDJPY, USDCAD, USDCHF).
3. Attach the EA to an XAUUSD M15 chart and allow algorithmic trading. The defaults are already optimal.
4. Set LotsXAU for your balance and risk tolerance, start at the minimum, and run forward on a DEMO account for one to two months first.
Important - please read
The edge is regime-conditional: it is strongest in anti-USD / gold-strength environments and weaker in sustained strong-USD regimes. The published backtest is a single 1.5-year sample that includes a historic anti-USD rally; past performance does not guarantee future results. Use risk capital only, start with the minimum lot, and forward-test on DEMO before going live.
Core innovations
- Equal-dollar hedge: both legs carry identical USD notional, removing the translation leak (the residual reverts yet the hedged spread still loses) that undermines lagged-beta hedging.
- Volatility-target sizing: position size is scaled down automatically in high-volatility regimes (de-leverage only), compressing drawdown while preserving return.
- Regime gates: a gold/USD-index directional de-risk and a euro-leg regime gate cut exposure on the side a prevailing trend is pressing against.
- Institutional-grade execution: atomic two-leg entry with automatic rollback if one leg fails, magic-number restart recovery, a free-margin pre-check, a trading-session check and a spread filter.
Verified performance - real ticks
Tickmill MT5 - every tick based on real ticks (model 4) - 10,000 USD - 2025.01 to 2026.06 - commission (6 USD per lot round-turn) and real spreads included:
- Net profit +166.5% - Profit factor 1.37 - Sharpe 5.12 - Win rate 58.9% - Trades 1388
Inputs and parameters
Every parameter ships pre-optimized. Attach the EA to an XAUUSD M15 chart and it runs exactly as tested - no set file required. The inputs are organised into groups:
Symbols
- InpXAU / InpXAG / InpEUR - gold, silver and euro symbol names. Change these only if your broker adds a suffix (for example XAUUSD.m). Silver feeds the factor and is never traded.
Signal (please do not change)
- InpTF (M15), FactorWin, LoadWin, Zwin, EntryZ (2.0), ExitZ (0.6), StopZ (4.0), MaxHoldBars (64), UseFlip. These define the residual z-score signal and the entry / exit / stop levels. They were fixed by walk-forward testing; changing them departs from the validated configuration.
Position and sizing
- LotsXAU (0.10) - gold-leg lot size and the single leverage / return knob. The euro leg is sized automatically from the hedge ratio. Scale LotsXAU linearly to your balance (about 0.10 per 10,000 USD) and start small.
- HedgeConst (1.0) - equal-dollar hedge constant (recommended). Set 0 to use an estimated beta instead.
- AdverseStopPct (1.5) - closes the whole basket if floating loss exceeds this percent of the gold-leg notional (0 = off).
- ShortSizeMult (0.7) - size factor for the short-spread (short-gold) side; below 1 reduces it, 1 is symmetric.
- LongSpreadOnly (false) - set true to trade the long-spread side only. In testing this gives a higher risk-adjusted return and a lower drawdown, at the cost of a mild long-gold tilt.
Regime gates (risk control, on by default)
- UseDxyGate / DxyBasket / DxyThr / DxyWin - de-risk a leg when the broad USD trend (a seven-pair USD-index proxy) opposes the position.
- UseEuroGate / EuroGateWin / EuroGateThr / EuroGateMult - reduce the euro hedge in strong gold trends, where the euro leg is negative carry.
- TrendDeriskMult / TrendDeriskWin / TrendDeriskThr - reduce the side a strong gold trend is pressing against.
- UseVolTarget / VolWin / VolRefWin / VolScaleLo / VolScaleHi - scale position size down in high-volatility periods (de-leverage only).
Execution and filters
- Magic (109222) - order identifier; change it if you run several copies on one account.
- DeviationPts (10) - maximum slippage in points. MaxRetries (3) - order retries per leg.
- MaxSpreadXAU / MaxSpreadEUR - skip new entries when the spread is wider than this (in price).
- EnableTrading (true) - master switch (false computes the signal only). InpVerbose - detailed log. DumpTag - equity export for charting.
How to deploy
1. Use a hedging account.
2. Make these symbols visible in Market Watch with history: XAUUSD, XAGUSD, EURUSD and the USD-index basket (EURUSD, GBPUSD, AUDUSD, NZDUSD, USDJPY, USDCAD, USDCHF).
3. Attach the EA to an XAUUSD M15 chart and allow algorithmic trading. The defaults are already optimal.
4. Set LotsXAU for your balance and risk tolerance, start at the minimum, and run forward on a DEMO account for one to two months first.
Important - please read
The edge is regime-conditional: it is strongest in anti-USD / gold-strength environments and weaker in sustained strong-USD regimes. The published backtest is a single 1.5-year sample that includes a historic anti-USD rally; past performance does not guarantee future results. Use risk capital only, start with the minimum lot, and forward-test on DEMO before going live.
