← Backtesting guides

XAU/USD backtesting ·

XAU/USD Backtesting: How to Test a Gold Strategy on H1

Maintained by the Backtest Editorial Team · Editorial policy

Does a gold pullback rule still work after trading costs? Start with hourly candles and the three-month Pullback preset below. Record which gold instrument you tested before comparing the result with your own trades.

Which gold price should you backtest?

XAU/USD quotes gold in US dollars. XAUUSDT is a perpetual futures contract quoted in USDT. Select the same contract and data source on both runs. To compare against a broker's spot fills, use that broker's price feed, spread and trading hours.

Test this setup in Backtest

Open the web app with the market, timeframe, and strategy from this guide already filled in. Adjust fees, slippage, stop loss, and take profit before running the test.

Open the gold pullback setup

Run a gold pullback test on hourly candles

  1. Open the Pullback preset and note the contract, start date and end date of the three-month window. Those dates let you repeat the test later.
  2. For a baseline, try both directions with a 1.5% stop and 3% target. These are example inputs. Set commission and slippage to match the fills you intend to model.
  3. Inspect the entries and exits, net return, number of trades and maximum drawdown. Keep the rules fixed and test on a separate period to see whether the result holds.

Read the result after costs

Suppose four simulated trades earn 2R each and six lose 1R each. The ten trades earn 2R before costs. At 0.2R per round trip, they break even. Here 1R is the amount initially at risk on each trade. A win rate alone would miss the effect of costs.

Before comparing runs, use the XAU/USD lot-size example to convert a fixed risk budget and stop distance into an illustrative quantity. Confirm your broker’s contract size and lot step, then keep the same sizing rule across variants.

Use the free backtest cost calculator to try your own assumptions, or see how to set up a gold breakout test.

Related gold strategy checks

Gold traders should compare XAU/USD behavior with forex backtesting, review SL/TP risk settings, and test indicator timing such as RSI recoveries.

Important limitation

Gold backtests depend on available market data and timeframe limits. Historical results are hypothetical and do not guarantee future performance. Backtest does not place real trades and is not financial advice.

Backtest Methodology: How Strategy Tests Are Calculated

XAUUSD Strategy Tester for Gold Breakouts

Use the gold breakout preset as a separate experiment from the pullback setup above. It requests XAUUSDT H1 candles, three months and both directions; confirm the actual dates in the form. Set stop, target, units, per-fill commission and slippage. Inspect the largest losing trade, then repeat the same dates changing only slippage. At a hypothetical reference price of 2,000 USDT, a long entry with 5 basis points of adverse slippage is 2,001; 10 basis points gives 2,002. Per-fill fees are additional. Spot XAU/USD and a USDT-settled perpetual can have different prices, hours and funding.

Illustrative numbers, not a historical result. Fees and slippage are excluded from this arithmetic.

2000 × (1 + 5 / 10000) = 2001 USDT
2000 × (1 + 10 / 10000) = 2002 USDT

Open the gold breakout tester

Backtest Trading

Backtest Trading · iOS & Android

Run another setup, inspect every simulated trade, and keep your strategy research close at hand.