MarketData Hub

Backtesting a Gold Strategy on Historical Data

Gold is many people's first serious backtest — trending enough to be encouraging, liquid enough to feel tradable. It is also a series with three traps that generic backtesting advice never mentions, because they are specifically gold-shaped. This guide picks the right granularity for the strategy you're testing, walks the regimes the archive actually covers, and names the traps before they name themselves in your equity curve.

Get the app — €9 →
A finished MarketData Hub download: a CSV file on local disk, with its row count, file size and full path.
Where the data ends up. A finished job names the row count, the file size and the exact path — a folder you chose, with no server of ours in the picture.

Pick the granularity the strategy needs — not the most

The XAU/USD archive runs from monthly candles down to raw ticks, and the right choice follows the strategy's holding period:

File sizes per timeframe are on the instrument page; the general trade-offs in tick vs OHLC.

What the history actually spans

The daily series from 1999-06-03 covers the entire 2000s bull market, the 2011 top, the 2013 crash, the 2015 trough and everything since — several genuinely different regimes: trending, mean-reverting, quiet, violent. That breadth is the point of backtesting gold on decades rather than years — a strategy tuned on one regime and shown the others is where most gold curve-fits die. Walk-forward validation and the other generic defences are in the main backtesting guide; they all apply here.

The three gold-specific traps

A workflow that holds up

Download daily first and prove the idea has a pulse over the full 1999-06-03-onward span. Only then buy resolution: intraday candles for timing, ticks if fills matter. Keep the final out-of-sample years untouched until the end. The tooling is format-agnostic — pandas, DuckDB/SQL, or MetaTrader — all fed from the same local downloads. If the idea generalises beyond gold, the other metals series run on the same session calendar, so the traps above transfer with it.

Frequently asked questions

How much gold history is enough for a backtest?
As much as the strategy's horizon needs to see several regimes. Daily-signal systems should use the full daily series (from 1999-06-03 here — the 2000s bull, 2011 top, 2013 crash, 2015 trough and since). Intraday systems are bounded by the intraday archive (from 2003-05-05).
Should I backtest gold on ticks or candles?
Candles, unless the strategy is spread- or fill-sensitive. Tick backtests are slower, the files are orders of magnitude larger, and for signal research the extra resolution changes nothing. Prototype on candles; confirm execution assumptions on ticks at the end.
Why does my gold backtest disagree with the same strategy on another platform?
The usual suspect is the daily cut-off: spot gold trades ~23 hours and platforms close their "day" at different times, so daily opens, closes and signals keyed to them legitimately differ. Compare cut-off conventions before suspecting the data.
Does the licence limit how much gold history I can backtest?
No — every tier reaches the full catalogue and the full history. Tiers differ by software features only (from €9, one-time). The limit that actually binds is the tick era's start date, which is a property of the archive, not the licence.

Related markets

Related guides