How to backtest a forex strategy, step by step
Backtesting means trading your strategy on past prices to see how it would have done. Done properly, it tells you in a few evenings what live trading would take months, and real money, to teach you.
Why backtest at all?
Most traders find a setup on social media, try it live for a week, lose a few trades and move on to the next one. They never collect enough trades to know whether the setup works. A backtest fixes that: you take 50 to 100 trades with the same rules, on real history, and the numbers tell you whether the strategy has an edge.
Step 1: Write your rules down
If you can’t write a rule, you can’t test it. Before you open a chart, write down:
- Market and timeframe: for example EURUSD on the 15-minute chart.
- Entry: exactly what has to happen before you buy or sell.
- Stop loss: where you are wrong (below the swing low, 20 pips, and so on).
- Take profit: a fixed target such as 2R (twice your risk), or a clear exit rule.
- Risk per trade: for example 1% of the account.
- When you trade: for example only during the London session.
Step 2: Pick a period and hide the future
Choose a stretch of history you haven’t studied, ideally a few months that include trending and ranging weeks. The most important rule of backtesting is that you must not see the candles after your entry. If you can see where price went, you will “find” perfect entries that you would never have taken live.
In PlayBack Forex you press PlayBack and click the candle where your session starts. Everything after that candle disappears, exactly as it was at that moment.
Step 3: Step forward one candle at a time
Move forward candle by candle, or let the chart play at a speed you can follow (0.5x to 10x). When your entry rule appears, place the trade with your stop loss and take profit, just as you would live. Don’t move your stop because you “have a feeling”: the point is to test the rules, not your hindsight.
Tip: backtest on the timeframe you plan to trade. A strategy that works on the daily chart may fall apart on the 5-minute chart, where the spread is a much bigger share of each move.
Step 4: Record every trade
Write down the date, pair, direction, entry, stop, target, result in R and a one-line note (“entered late”, “news candle”). PlayBack Forex does this for you: every trade goes into the history with its result, and you can export it as CSV.
Step 5: Read the numbers
After 50 or more trades, look at:
- Win rate: the share of trades that made money.
- Average win vs average loss: a 40% win rate is fine if your winners are twice the size of your losers.
- Profit factor: money won divided by money lost. Above 1.0 makes money; above 1.5 is good.
- Maximum drawdown: the biggest drop from a high point in your balance. Ask yourself whether you could live with it.
Our guide to reading win rate, profit factor and drawdown explains each number in detail.
Step 6: Change one thing and test again
If the results are weak, change one rule (a different stop, a session filter) and test a fresh period. Changing several things at once means you won’t know what helped. When the strategy holds up across different months and pairs, move to small live size.
Common backtesting mistakes
- Peeking at the future. Always hide the candles to the right of your entry.
- Too few trades. Ten trades prove nothing; aim for 50 to 100.
- Ignoring costs. Set a realistic spread and commission; they eat small targets.
- Testing only one market mood. Include trending and ranging periods.
- Bending the rules. If you skip trades you “don’t like”, you are testing your mood, not your strategy.
Try it on real history
Open PlayBack Forex in your browser, pick a pair and a start candle, and trade the chart as it unfolds. Free to start.