How to Backtest a Forex Strategy (Step by Step, With a Worked EURUSD Example)

A complete, honest backtesting workflow: write rules you cannot bend, take a 100-trade sample across real market regimes, log every trade, and read the results without fooling yourself.

TraderEdge Team

Backtesting basics//7 min read

Most backtests fail before the first trade is taken. Not because the strategy is bad, but because the test is rigged: rules that bend, a sample cherry-picked from a friendly year, losers skipped with "I would not have taken that one live". The result is a beautiful equity curve and a strategy that dies in its first live month. This guide is the workflow we would hand a friend: eight steps, one worked example on EURUSD, and the discipline that makes the final numbers worth believing. It assumes nothing about which software you use; the steps run the same way in any replay tool, and we will note where the tool matters.

Step 1: Write rules you cannot bend

A strategy is not "I buy breakouts when it feels strong". It is a set of rules a stranger could follow and get the same trades. Our worked example is a classic, the London breakout on EURUSD, written the way your rules should be written:

  • Setup: Mark the high and low of the Asian session range (00:00 to 07:00 London time) on the 15-minute chart.
  • Entry: If price breaks the range high by 5 pips or more during the London session, buy. Mirror for shorts below the range low. One trade per day, first break only.
  • Stop: The opposite side of the range, capped at 40 pips; skip the trade if the stop would be wider.
  • Target: 1.5 times the stop distance, or exit at the New York close, whichever comes first.
  • Risk: 0.5% of the account per trade. No discretionary exits, no moving the stop.

Notice what this excludes: no "skip it if the news looks bad", no partial profits when nervous. Every judgement call you leave in the rules is a place where hindsight will leak into the test. If a rule genuinely needs discretion, define the discretion ("skip days with a red-flag news event at the open") before you start, and apply it to the whole sample.

Step 2: Choose a sample that can hurt you

The single most common testing error is sampling only the recent past. Recent EURUSD is one regime; your strategy will live through several. Take at least 100 trades, and build the sample from deliberately different conditions: a crisis period (2008 or March 2020), a strong trend, and a flat, grinding range. On a major pair with deep history this is easy to do honestly: run the same frozen rules over 2008 to 2009, then 2014 to 2015, then a recent two-year block, and keep the three results separate. A strategy that only works in one block has told you something important. This is where data depth stops being a spec-sheet number: a tool whose history starts in 2019 simply cannot run the first two blocks. Our comparison of backtesting software scores exactly that.

Step 3: Set your pass marks before you run

Decide now, while you have no results to protect, what "good" means. Reasonable first gates for a discretionary intraday strategy: profit factor above 1.2 in every block (not just on average), maximum drawdown you could genuinely sit through live, and expectancy (step 6) positive in every block. Write the gates at the top of your test notes. Moving them after you see the results is the quietest form of self-deception in trading.

Step 4: Run it in replay, honestly

Open your replay tool, set the start date to the first block, and step forward bar by bar. In TraderEdge this is the replay backtester: you pick EURUSD, set the date, and the chart reveals one bar at a time on the same TradingView charts you would trade live, with the session panel tracking your running P&L as you go. The mechanics matter less than three rules of conduct:

  • Never peek. Do not jump forward to "see if it worked". If your tool lets you hide future bars, keep them hidden. Every peek converts a test into a story.
  • Take every signal. The trade you skip because it "looks wrong" is the trade that makes the sample honest. Log it.
  • Trade at your real speed. If you scalp, replay at a pace where you would actually make the decision live. Testing a 15-minute strategy at leisurely daily speed flatters your execution.

Work through the block trade by trade. On a one-trade-per-day strategy like our example, 100 trades is roughly five months of sessions per block, an evening or two of replay per block. That is the real cost of a trustworthy answer, and it is cheaper than learning the same lesson live.

Step 5: Log every trade like a journalist

A backtest you cannot audit is an opinion. For every trade, record: date and session, pair, the rule that triggered entry, entry, stop and target prices, the result in R (multiples of your risk, not just pips or dollars), and one line on anything you noticed. Tag mistakes honestly: late entry, oversized range, traded into news. In TraderEdge every replay trade lands in your saved backtests automatically with its stats and equity curve, and Elite adds the trading journal and PnL calendar so your backtest log and your live journal sit in one place, in the same format. On paper or in a spreadsheet the same fields work; the format matters less than never skipping a row.

Step 6: Read the results without fooling yourself

Four numbers carry almost all of the information in a finished sample:

  • Win rate alone means nothing. A 35% win-rate strategy can be excellent and a 70% one can lose money. It only earns its keep in the next calculation.
  • Expectancy is the average R earned per trade: (win rate × average win) − (loss rate × average loss). It is the single best summary of whether the rules make money.
  • Profit factor is gross wins divided by gross losses. Above 1.0 is profitable; the gates from step 3 apply.
  • Maximum drawdown, in R, is what the strategy will demand from you emotionally. Compare it honestly with what you would actually tolerate before quitting.

Our worked example, with illustrative results from a completed 100-trade sample: 42 wins, average win 1.8R, 58 losses at 1R each. Expectancy = (0.42 × 1.8) − (0.58 × 1.0) = 0.756 − 0.58 = +0.176R per trade, roughly +17.6R across the sample. Profit factor = (42 × 1.8) ÷ (58 × 1.0) = 75.6 ÷ 58 = 1.30. Against the gates: profit factor clears 1.2, expectancy is positive, and if the worst drawdown in the sample was, say, 9R, the follow-up question is whether the same held in the other two blocks, not whether 1.30 feels exciting. EdgeScore exists to compress exactly this judgement (profitability, risk, consistency) into one comparable number per session, which is handy when you run the same rules across three blocks and two rule variants.

Step 7: Try to break it

A strategy that survives your attempt to kill it is worth more than one that posts a pretty curve. Shift the key parameters by about 20% (range buffer 4 and 6 pips instead of 5, target 1.25R and 1.75R) and confirm the results degrade gently rather than collapse; collapse means you fitted noise. Add realistic costs: your broker's actual spread on EURUSD plus a pip of slippage on entries, and re-check expectancy. Then re-run the worst block and look at the losing streaks specifically: are they a regime the rules cannot handle (consider a filter, tested as a new sample, not patched onto this one) or just the cost of doing business? For the classic traps in this phase, our breakdown of backtesting myths is the companion read, and the top 5 tools roundup shows how different tools handle the record-keeping.

Step 8: Decide, then forward-test small

Compare the finished sample against the gates you wrote in step 3, not against your hopes. Three outcomes are all useful: it passes everywhere (rare, and the best result), it fails everywhere (you just saved real money), or it passes in some regimes only (trade it with a regime filter, or park it). Whatever passes goes to a small live or demo forward test, because a backtest proves a strategy worked on history, not that you can execute it at 7am with real money on the line. Size it so the tuition is cheap if you are wrong.

You can run this entire workflow on the free plan: the interactive demo shows the replay mechanics in your browser, and the pricing page lays out what the free plan covers (three pairs, saved backtests) versus the paid tiers. Pick your ugliest strategy first. The one you are most afraid to test honestly is the one this process exists for.

Frequently asked questions

How many trades should a backtest include?

At least 100 trades for a first verdict on a single strategy and pair. Below that, luck dominates: a coin-flip strategy can look brilliant over 25 trades. If your rules only trigger a few times a month, widen the date range rather than shrinking the sample.

How far back should I backtest?

Far enough to include hostile conditions, not just recent ones. For a major pair, aim for a sample that spans a crisis, a trending period and a flat range. With data back to 2000 you can include 2008 and the 2015 franc shock; five recent calm years is the weakest sample you can take.

What is a good profit factor for a backtest?

Treat 1.2 as a minimum worth investigating and 1.5 or above as strong, but only alongside drawdown and sample size. A profit factor of 2.0 over 30 trades in one good year usually means you have curve-fit the year, not found an edge.

Can I backtest a strategy for free?

Yes. TraderEdge has a free plan with replay backtesting on three pairs and saved backtests, which is enough for a full first sample, and there is a browser demo if you want to feel the workflow first. Free tiers limit pairs and history depth, not the honesty of the method in this guide.

What is the biggest backtesting mistake beginners make?

Changing the rules mid-sample. The moment you skip a loser you 'would not have taken' or move a stop 'just this once', the sample stops describing the strategy and starts describing your hindsight. Write the rules down, freeze them, and let the sample finish before you judge anything.

Try it yourself

Test this on real data back to 2000.

Replay the market bar by bar, place trades and get an EdgeScore™ on the result. Free plan, no card required.

Found this useful? Share it with a trading buddy.

Share on X

Keep reading

All posts →

Stop guessing. Start testing.

Free forever plan, no card required. Every paid plan still starts with a 5-day free trial.