TrueTestHonest results, on the record.

How to test a gold (XAUUSD) EA properly

EA Trade TesterDemo labHow we testFor AI agents

Published · methods v2.5 · by TrueTest

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.

Test my gold EA freeSee a full example first

Drop your .mq5/.mq4 code, a Python bot or an MT5 report on the home page. The first read takes seconds and needs no sign-up; the lab verdict is free too. Only the detailed technical report is paid (the full PDF report is GBP 49). The price shown is the total price: no VAT is added. TrueTest is not VAT-registered in the UK. We read your code as text and never run it as given; an outside AI service drafts the rule card only if you tick the box (see Security). Not financial advice.

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 hourRound trip, US dollars an ounceOn a 5 dollar stop
10:00 (London morning)0.670.13 R
00:00 (the daily roll-over)0.780.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

More guides: MT5 Strategy Tester report checker · How many backtests? Overfitting explained · TrueTest vs StrategyQuant, Forex Tester, MT5 · MQL5 / MQL4 EA code checker · EA trading at the wrong hour? Server time · Why live results are worse than the backtest · Does my EA repaint or look ahead? · Can a scalping EA make money after costs? · Does my EA make money every year? · Will my EA pass a prop-firm challenge? · What to check before you buy an EA

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.