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
- Pick a starting point at least 6–12 months back, so you cover different conditions: trends, ranges and news-driven weeks.
- Hide the future. Use Bar Replay so you can't see what happens next. Looking ahead is the most common way backtests lie.
- Step forward candle by candle. When your rules trigger, record the trade exactly as written: entry, stop and target.
- Play it out and record the result in R (e.g. −1R, +2R). Include a spread allowance.
- Record every valid setup, especially the ones you "wouldn't have taken". Skipping trades that look bad in hindsight is cheating yourself.
- 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.
Analyse your results
Enter your backtest win rate and average R to see your expectancy.
Analyse your resultsEducation only, not financial advice. Trading leveraged products carries a high risk of loss.