How to backtest a forex strategy with bar replay

Backtesting shows how a strategy would have done on past prices. With bar replay the chart reveals one candle at a time, so you make each decision the way you would live, without seeing what happens next. Here's a step-by-step method that gives you results you can trust.

Updated 16 October 2026

Manual or automated backtesting?

There are two ways to backtest:

  • Automated: you code the rules, in MQL5, Pine Script or Python for example, and a tester runs them over years of data in seconds. It's fast and repeatable, but it only works for rules that can be written as code.
  • Manual, with bar replay: you step through historical charts and take trades by hand. It's slower, but it works for strategies that rely on judgement, like price action, supply and demand or smart money concepts, and it trains the execution you'll need live.

Most discretionary traders use bar replay, and the rest of this guide is about doing it well.

Step 1: write your rules down

Before you open a chart, write the strategy down precisely enough that someone else could follow it:

  • the markets and timeframes you trade, and the hours, such as the London and New York sessions;
  • the setup: what has to be true before you look for an entry;
  • the entry trigger;
  • where the stop loss goes, and how you take profit or exit;
  • how much you risk per trade;
  • when you don't trade, for example around major news.

If a rule can't be written down, it can't be tested: you'd only be testing your mood that day.

Step 2: choose your data and period

A strategy that only worked in one kind of market isn't one you can rely on. Test it across periods that behaved differently, trending and ranging, quiet and volatile: the low volatility of 2019, the swings of March 2020 and the strong dollar of 2022 all reward different behaviour.

Aim for at least 100 trades before you trust the numbers. With 20 or 30, a lucky or unlucky streak can make a weak strategy look great or a good one look broken.

Step 3: replay without hindsight

Hindsight is the biggest threat to a manual backtest. If you can see what price did next, you'll find perfect setups you'd never have taken live. To keep the test honest:

  • Start on a random date, so you don't remember what happened next.
  • Keep the future hidden. Bar replay only shows candles up to the current moment, on every timeframe; don't check another chart that's further along.
  • Step forward; don't skip ahead to find setups. Move candle by candle or play the chart at a steady speed, and act only on what you'd have seen.
  • Settle trades on a small timeframe. It shows whether your stop or your target was really hit first, which hourly and daily candles hide.

Step 4: log every trade

Record each trade as you take it: date and time, market, direction, entry, stop, target, the result in R (the profit or loss as a multiple of the amount risked) and a short note on why you took it. Note the setups you skipped and why, too. A screenshot of each entry is worth keeping: you'll learn more from reviewing them later than from the numbers alone.

Step 5: read the results honestly

Once you have enough trades, work out:

  • Win rate: the share of trades that made money.
  • Average win and average loss, in R.
  • Expectancy: (win rate × average win) − (loss rate × average loss), the average result per trade. A 45% win rate with 2R winners and 1R losers gives 0.45 × 2 − 0.55 × 1 = 0.35R a trade.
  • Profit factor: gross profit divided by gross loss. The example above gives 0.9 ÷ 0.55 = 1.64; anything below 1 loses money.
  • Max drawdown and the longest losing streak, which matter most under prop firm rules.

Step 6: test it under prop firm rules

A strategy can make money over a year and still fail a challenge in a week. What decides it is the size of the drawdowns compared with the rules. If your longest losing streak was eight trades and you risk 1% a trade, you need room for an 8% drawdown: more than a one-step challenge with a 6% max loss allows, and enough to break a 5% daily limit if the streak comes in a single day.

So the last test is to trade the strategy under the exact rules you'll face, including the daily loss limit, the type of max loss and the minimum days, and see whether it passes, how often and how quickly. The guide to prop firm challenge rules explains each of them.

Common mistakes

  • Peeking ahead, or going back to "re-check" a setup after seeing how it played out.
  • Stopping after a handful of trades.
  • Changing the rules halfway through, then counting trades from both versions.
  • Ignoring spread and commission, which add up quickly for strategies with small stops.
  • Testing only one market, or one kind of market.
  • Forgetting that a backtest isn't live trading: fear and impatience are missing, so expect live results to be somewhat worse.

Backtesting on PropDrill

PropDrill is a bar replay simulator built for exactly this. Choose from 36 markets, including forex majors and crosses, gold, silver and indices like NAS100 and GER40 (EURUSD and gold on the free plan). Start on a random day or one you pick since 2015, and replay real market data candle by candle or at the speed you choose, with the future hidden on every timeframe. Spread is included, every trade is logged with its result, and you can run the whole test as a prop firm challenge so the rules are enforced as you go. Start a free challenge to try it.

Questions

How many trades do I need in a backtest?

Aim for at least 100 before trusting the numbers. With 20 or 30 trades, one lucky or unlucky streak can make a weak strategy look good or a good one look broken.

Is manual backtesting better than automated?

Neither is better in general. Automated testing is faster and suits rules that can be written as code; manual bar replay suits strategies that need judgement, and it trains the way you'll trade live.

Why are my live results worse than my backtest?

A backtest leaves out fear, impatience and missed trades, and it's easy to let hindsight creep in. Spread, commission and slippage also add up. Expect live results to be somewhat worse, and treat a big gap as a sign the test wasn't strict enough.