Gold is one of the most popular symbols for expert advisors, and one of the easiest to fool yourself on. Its wide intraday range and sharp news moves make backtests very sensitive to how the tester rebuilds price inside each bar. MetaTrader 5's Strategy Tester gives you a choice of models, and that choice matters more on XAUUSD than on almost any other pair.
The MT5 tick models
| Model | How price is built | Good for |
|---|---|---|
| Every tick based on real ticks | Uses recorded broker ticks, including the spread at each tick | Final validation, scalpers, grid and basket systems |
| Every tick | Generates synthetic ticks inside each M1 bar | Rough logic checks |
| 1 minute OHLC | Only four prices per M1 bar | Fast optimisation of slow strategies |
| Open prices only | Only the bar open | EAs that act strictly on bar open |
Why generated ticks flatter gold EAs
- Spread is smoothed: generated modes typically use the spread from bar data or a fixed value, so the rollover and news spikes that hit gold are missing. Stops that would have been triggered by a spread spike never fire.
- Path inside the bar is invented: when both take-profit and stop-loss sit inside one M1 range, the generator decides which was touched first. On fast gold bars that guess often favours the strategy.
- Grid and basket systems look safer: systems that close many small baskets are especially sensitive. A few points of missing spread on every close adds up to a large difference over thousands of trades.
A practical XAUUSD test checklist
- Use real ticks from the broker you plan to trade, and check that the history has no large gaps.
- Cover several regimes: a strong trend year, a ranging period and at least one high-volatility shock.
- Hold back out-of-sample data: optimise on one period and confirm on a later one you did not touch.
- Stress the spread: rerun with spread doubled, and once more with a news-hour level, to see how much edge survives.
- Read drawdown first: maximum equity drawdown, not balance drawdown, especially for systems that hold floating losses.
- Count the worst losing streak and ask whether you could sit through it live.
- Forward-test on the same broker before using real money.
Common gold-specific traps
- Symbol differences:
XAUUSD,XAUUSD.morGOLDcan have different contract sizes and digits. Read the symbol specification before trusting lot-based risk. - Server time: session filters written for one broker's time zone shift by hours on another. Use broker-independent time logic or make the offset an input.
- Swap: long-holding gold positions pay or receive swap every night, with a triple charge on one weekday. Include it in the test.
Rule of thumb: if an XAUUSD robot's results change a lot between real ticks and generated ticks, trust the real-tick result and treat the difference as the size of the illusion.