Live prices is unavailable right now.

Live data comes from TradingView. Open XAUUSD on TradingView

Learn / Testing

How to backtest a gold trading strategy (step by step)

By ZRBFX · 7 min read · Updated November 2026

Backtesting means applying your rules to past price data, trade by trade, to see how they would have performed. It's the fastest way to find out whether a strategy is worth risking money on, and to build the confidence to follow it through a losing streak.

What you need

  • Written, specific rules. If two people could read them and take different trades, tighten them.
  • A charting platform with a replay feature. TradingView's Bar Replay works well, including on free plans with some limits.
  • A spreadsheet or journal with columns for date, direction, entry, stop, target, result in R, and notes.

Step by step

  1. Pick a starting point at least 6–12 months back, so you cover different conditions: trends, ranges and news-driven weeks.
  2. Hide the future. Use Bar Replay so you can't see what happens next. Looking ahead is the most common way backtests lie.
  3. Step forward candle by candle. When your rules trigger, record the trade exactly as written: entry, stop and target.
  4. Play it out and record the result in R (e.g. −1R, +2R). Include a spread allowance.
  5. Record every valid setup, especially the ones you "wouldn't have taken". Skipping trades that look bad in hindsight is cheating yourself.
  6. Collect 50–100 trades before you judge the result.

Reading the results

  • Win rate and average win in R give you your expectancy. You want it clearly positive after costs.
  • Longest losing streak: can you survive it at your risk per trade? Check with the streak simulator.
  • Maximum drawdown in R: would it break a prop firm's limit?
  • When it works: sort by session and by trend versus range. You'll often find a filter that improves results.

Then forward-test

A good backtest is a reason to demo trade, not to go live. Trade the rules on a demo account for a month and compare. If live behaviour and results look like the backtest, start live with the smallest size.

Beware of curve fitting. If you keep adding rules until the past looks perfect, the strategy will likely fail on new data. Simple rules that work reasonably across lots of conditions beat complex ones that worked perfectly once.

Analyse your results

Enter your backtest win rate and average R to see your expectancy.

Analyse your results

Education only, not financial advice. Trading leveraged products carries a high risk of loss.

FREE EVERY MONDAY

Get the weekly gold outlook by email

Plus the free 10 Golden Rules of Trading Gold PDF when you join. No spam. Unsubscribe any time.