How to test a gold (XAUUSD) EA properly
EA Trade TesterDemo labHow we testFor AI agents
Gold is one of the most popular symbols for sold EAs, and also one of the easiest to fool yourself on. In our price data gold went from about 1,180 US dollars an ounce in August 2010 to about 4,380 in September 2026, with its steepest rise since 2024, so a long-only gold EA can look clever just by being in the market. Its costs are counted in US dollars an ounce, not pips, and they change a lot through the day.
What does a gold trade really cost?
From our cost record (one retail broker's raw spread, recorded since October 2023, median per server hour), one round trip of gold in our lab costs the spread + 2 US cents an ounce slippage when the trade opens + GBP 5 a lot commission + our safety margin of 48 US cents an ounce:
| Server hour | Round trip, US dollars an ounce | On a 5 dollar stop |
|---|---|---|
| 10:00 (London morning) | 0.67 | 0.13 R |
| 00:00 (the daily roll-over) | 0.78 | 0.16 R |
So a gold scalper with a 5 dollar stop pays about an eighth of its risk on every trade before it has any edge. Check your own numbers with the trading-cost calculator.
Why does gold need a drift control?
When a market rises for years, buying almost anything at almost any time makes money. A real gold strategy must beat the same trades entered at a different time. Our drift control re-runs the trades with the entry shifted one day later; a real timing signal should beat it. In our research, 46% of the failed tests did no better than simply being in the market at the same times.
How much history is enough?
We test gold from August 2010 to 18 September 2026, in three separate periods that never overlap, with every calendar year shown. A gold EA that only made money since 2023 has been tested on one kind of market: a strong, steady rise.
What about swaps?
Holding gold overnight costs a swap, and Wednesday night counts three times. Our lab charges overnight fees from a dated broker table; an EA that holds trades for days can lose its whole edge to swaps. Read more on EA trading costs.
Related pages
- EA costs: spread, commission and swap
- Is my EA backtest real or luck?
- Is my EA martingale or grid? How to tell
- Free forex EA tester online
- EA Trade Tester home: test your EA, bot, indicator or report
Questions people ask
Do you test XAUUSD under that name?
Our symbol is called GOLD (the spot price in US dollars an ounce); an XAUUSD EA is tested on it. Your broker's symbol name in the code does not matter.
Is gold harder to pass than forex?
Often, because its costs are a bigger share of a typical stop and its long rise flatters long-only rules. The same checks apply to every symbol.
Can I test a gold EA I bought as .ex5?
We cannot read compiled files. Send its Strategy Tester report and we check the trades.
Is a gold EA that passes safe to trade?
No test makes trading safe. A pass means the backtest cleared our checks; the forward watch on new prices is the next step. Not financial advice.