Advanced · Lesson 4 of 9 · 7 min read

Backtesting and Replay

Testing an idea on past prices before risking money is one of the best habits a trader can build, as long as you know why past results always look better than real ones.

BacktestingBar ReplaySample sizeHonest results

What backtesting is

Backtesting means applying your trading rules to past prices to see how they would have done. It shows whether an idea has any edge at all, how often it wins, and how bad the losing streaks get, before you put real money on it.

Practising with Replay

BTM’s Replay button takes the chart back to a date you choose and plays it forward candle by candle, hiding what comes next. You can buy and sell as if it were live, with your own account size, risk, stop and target.

  1. Write your rules down first: when you enter, where the stop goes, where you take profit.
  2. Pick a start date and press play, or step one candle at a time with Shift and the arrow keys.
  3. Take only trades that match your rules, and log each one.
  4. Do this on different markets and different months, not just one good week.
Key idea

Replay is only useful if you are honest. Skipping the trades you “would not really have taken” after seeing them lose turns a test into wishful thinking.

How many trades is enough?

A handful of trades proves nothing: luck can make anything look good over 10 trades. Aim for at least 50 to 100 trades across different market conditions before trusting a result.

Number of tradesWhat it tells you
10Almost nothing: could easily be luck
50A first rough idea
100 or more, in trends and rangesSomething worth taking forward to small live trades

Why real results are worse

Tests on past prices often ignore spread, commission, swap and slippage, and they never feel the fear of a real loss. Over-fitting, tweaking rules until they fit the past perfectly, makes it worse.

Worked example

A test shows 100 trades with an average win of 1.4R and an average loss of 1R, winning 45% of the time. That is +0.18R per trade before costs.

If costs take about 0.1R from every trade, the edge drops to +0.08R. Still positive, but less than half. Always count costs in, then start live with very small size.

Common mistakes

Avoid these
  • Testing on one market in one good month.
  • Changing the rules halfway through the test.
  • Ignoring costs and slippage.
  • Going straight from a good test to full-size live trades.

Check yourself

1. You win 8 of your first 10 Replay trades. Is the strategy proven?

No. 10 trades is far too few: it could easily be luck.

2. Why are live results usually worse than backtests?

Costs, slippage and emotions, plus over-fitting to the past.

3. What should you do before you start a backtest?

Write your rules down, so you cannot change them to fit what you see.

Try it on BTM

For education only, not financial advice. Trading carries a high risk of losing money, especially with leverage. Only trade with money you can afford to lose.

For educational purposes only. Nothing here is financial advice. Past performance does not guarantee future results, and trading carries a high risk of losing money, so only trade with money you can afford to lose. Read the risk warning.