EUR/USD1.09986GBP/USD1.31862USD/JPY159.462USD/CHF0.83988AUD/USD0.67398USD/CAD1.42979NZD/USD0.55013EUR/GBP0.83412XAU/USD3857.28EUR/USD1.09986GBP/USD1.31862USD/JPY159.462USD/CHF0.83988AUD/USD0.67398USD/CAD1.42979NZD/USD0.55013EUR/GBP0.83412XAU/USD3857.28

Forex backtesting: how to test a strategy with replay, MT5 and real data

Gold signals explained: how our gold signals work · every closed gold signal

Forex backtesting means running a fixed set of trading rules over past price data to see how they would have performed before you risk money. You can do it by hand with bar replay, with software such as the MetaTrader 5 Strategy Tester, or by analysing a full record of real trades. Done honestly, it tells you whether an idea is worth forward testing; done carelessly, it tells you what you want to hear.

This guide covers all three methods, the biases that ruin most backtests, how many trades you need, forward testing on demo and a worked example that uses our public record to compare exit plans for the same forex signals.

Free on Telegram. Forward test your own judgement against live gold and forex swing ideas, each with a stop and three targets, in our free channel.

Follow the channelFree, opens Telegram

What is forex backtesting, and what can it tell you?

A backtest replays history through a set of rules. For every past moment the rules would have traded, you record the entry, the stop, the exit and the result. Added up, those trades give you the numbers that matter:

  • Expectancy: the average result per trade, ideally measured in R (multiples of the amount risked). Our expectancy calculator works it out from your win rate and average win and loss.
  • Win rate: useful, but only alongside the size of wins and losses.
  • Drawdown and streaks: the worst run of losses, which tells you what risk per trade you can live with.
  • Behaviour by market and session: whether the idea works on gold as well as on EUR/USD, or only in the London session.

What a backtest cannot do is promise the future. UK financial promotion rules require firms that show past performance to state that it is not a reliable indicator of future results, and the same caution applies to your own tests. A good backtest tells you an idea deserves further testing. It does not tell you it will work next month.

Write your rules before you test

The most common reason backtests fail is vague rules. If a rule needs judgement in the moment, you will judge it differently once you can see what happened next. Before you look at a single chart, write down:

  1. Markets and timeframes: for example EUR/USD and gold on the 4 hour chart.
  2. Entry trigger: exactly what must happen, such as a close back above a broken level after a retest.
  3. Stop placement: beyond which swing, or how far in pips.
  4. Targets and exit plan: one target, several, or a trailing stop, and what happens to the stop after the first target.
  5. Filters: sessions to avoid, news to stand aside for.
  6. Risk per trade: a fixed percentage, so results can be read in R.

Test the rules exactly as written. If you feel the urge to change one halfway through, finish the test, record the result, then start a fresh test with the new version.

It also pays to split your history before you begin. Develop and adjust the rules on an earlier stretch of data, then run the finished version, untouched, on a later stretch you have not looked at. Traders call these in-sample and out-of-sample periods. If the rules only work on the data you built them on, you have learned something important before risking a penny. Keep a copy of each version of your rules with its results, so you can see whether a change genuinely improved the strategy or just fitted it more closely to the past.

Manual backtesting with bar replay and forex simulators

Manual backtesting, sometimes called chart replay, is the best way to test discretionary strategies such as price action or trend line trading. The idea is to hide the future and step through history one candle at a time, making decisions as if the market were live.

Your main options:

  • Bar replay in a charting platform. TradingView's Bar Replay lets you pick a starting point, hide everything after it and play the chart forward candle by candle. Some features, such as replay on lower timeframes, depend on your plan.
  • Visual mode in MetaTrader 5. The MT5 Strategy Tester can play history on a chart, which some traders use for manual practice.
  • Standalone forex simulators. Paid desktop and browser replay simulators let you place simulated orders on historical data across several markets. Check the data source, trading costs and terms before paying.

Whatever you use, log every trade in a spreadsheet with the date, market, direction, entry, stop, exit, result in R and a note on whether you followed the rules. Stop before you get tired; manual testing done in a rush becomes careless very quickly.

Using the MT5 strategy tester

The MetaTrader 5 Strategy Tester is a free strategy backtester built into the platform. It tests Expert Advisors, which are trading rules written in code, across historical data. Key settings to understand:

  • Modelling: options range from opening prices only, which is fast but crude, to every tick based on real ticks, which is slower but far closer to reality for strategies with tight stops.
  • Spread and costs: make sure the test uses realistic spreads and includes commission and swaps. Results without costs are not results.
  • Visual mode: watch the strategy trade on a chart to confirm it does what you intended.
  • Optimisation: MT5 can try thousands of parameter combinations. This is powerful and dangerous in equal measure, as the next section explains.
  • Forward period: the tester can hold back the most recent part of the data and run the chosen settings on it, a built-in check against overfitting.

If you do not write code, you can still test simple rule sets in TradingView's strategy tester or use the manual methods above. Coded testing only helps if the code matches your rules exactly.

Backtesting biases that make bad strategies look good

Most backtests look better than live trading. These biases are why:

BiasWhat happensHow to avoid it
Look-ahead biasRules use information that was not available at the time, such as a daily close for a trade taken at middayOnly act on closed candles; hide the future in replay
OverfittingSettings are tuned until they fit past data perfectly, then fail on new dataKeep rules simple; test on data you did not optimise on
Survivorship and selectionTesting only the pairs or periods that happened to trend, or a provider showing only its winnersTest every market and period you would have traded; insist on full records
Ignoring costsSpreads, commission, swaps and slippage are left outInclude realistic costs, especially on short-term trades
Hindsight in manual testsYou skip trades that look bad because you remember the chartUse markets or years you have not studied; log every valid setup

Costs deserve a special mention. A strategy with small targets can look excellent before spreads and turn negative after them. Our guide to forex spreads and swaps explains what to include.

How many trades do you need for a reliable backtest?

More than most people think. Win rates and averages swing a lot on small samples, and the worst streak in a strategy's life usually only shows up once you have a long record.

Our own record shows the effect. Across 3,000+ closed signals from 6 November 2023 to 26 October 2026, the success rate was 82.4%. Broken down by year, it moved around considerably:

PeriodSignalsSuccess rate
2023 (from November)15672.4%
20241,04482.8%
20251,06181.5%
2026 to date84285.0%

Single months varied even more, from 63.2% in December 2024 to 95.2% in July 2026. The longest losing streak, 12 stops in a row, would never appear in a test of a few dozen trades. The practical lesson: think in hundreds of trades rather than dozens, cover trending and ranging conditions, and include periods of major news. If your sample is small, treat the result as a hint, not a verdict.

Forward testing on a demo account

A backtest answers whether the rules would have worked. A forward test answers whether you can actually trade them. Run the same rules in real time on a demo account, logging every trade exactly as you did in the backtest.

Forward testing catches things a backtest misses:

  • Entries you would have missed because you were at work or asleep.
  • Spreads widening around news and at the daily rollover.
  • Your own hesitation, early exits and skipped trades.

Compare the forward results with the backtest. If they are broadly similar, the rules are probably sound and you are following them. If the forward test is much worse, the difference is usually execution or a bias in the original test. Our guide to moving from demo to a live account explains when the switch makes sense and how to start small.

Remember that demo results carry no emotional weight. Trading forex, gold and CFDs with real money carries a high risk of losing it, and UK retail CFD leverage is capped by the FCA at between 30:1 and 2:1.

Worked example: comparing exit plans with the Forexuro signal record

You do not need to code to run a meaningful test. Every closed Forexuro signal is published, losses included, and the full record is in our public trade history. Here is how to use it to answer one practical question: given the same signals, which exit plan works best?

  1. Copy the trades from the trade history into a spreadsheet, one row per signal. For each signal you need the outcome: stop, breakeven, or the furthest target reached (TP1, TP2 or TP3).
  2. Convert targets to R. Divide each target distance by the stop distance. Across the whole study the medians were 0.34R for TP1, 0.67R for TP2 and 1.00R for TP3.
  3. Apply each exit plan to every trade. A stop counts as minus 1R. For the plans that hold beyond TP1, assume the stop moves to entry once TP1 is hit, so a trade that reaches TP1 and then turns back closes at zero on the remaining part.
  4. Add up and divide by the number of trades to get the result per trade, then compare.

Our forex signals study runs exactly this test on all 3,000+ closed signals, using each trade's own distances:

Exit planPer tradeTotal
Close all at TP1+0.09R+285R
Close all at TP2+0.27R+842R
Hold all for TP3+0.39R+1,215R
A third off at each target+0.25R+781R

The lesson is the point of backtesting: the entries did not change, yet the result per trade ranged from +0.09R to +0.39R. A TP1-only trader needs a hit rate above 74.4% just to break even, because a win of about 0.34R must cover a full 1R loss.

Using backtests to judge a signal provider, including us

The same thinking applies when you assess any signal service. Ask for a complete record, not screenshots of winners, and test it the way you would test your own strategy: count every stop, convert to R, look at the weakest months and the longest losing streak. Our performance by week and month page shows the month-by-month picture, including the weakest months.

Be clear about fit, too. Forexuro signals are swing-style ideas on gold and major pairs, each with an entry, a stop loss and three targets, delivered on Telegram. They are not scalps and they are not coded strategies you can drop into the MT5 tester. If you want to test them, the trade history and the study are the way to do it. To see live ideas before deciding anything, follow a selection in our free Telegram channel, and read how the full service works on the forex signals page.

Official sources

Primary reference pages from regulators, central banks and official bodies on the topics in this article.

Frequently asked questions

What is the best forex strategy tester?

It depends on how you trade. For coded strategies, the MetaTrader 5 Strategy Tester is free with the platform and can model every tick from real tick data. For discretionary trading, bar replay in a charting platform or a dedicated replay simulator is better, because you make the decisions yourself.

Is there a free forex replay or trading simulator?

Yes. The MT5 Strategy Tester and broker demo accounts are free, and TradingView offers Bar Replay, although some replay features depend on your plan. Paid simulators add features such as multi-market replay and detailed trade statistics.

How many trades should a forex backtest include?

Think in hundreds of trades rather than dozens, spread across trending and ranging markets and news periods. In our own record the success rate ranged from 72.4% to 85.0% between years and from 63.2% to 95.2% between months, so small samples can easily mislead.

Is backtesting accurate?

Only as accurate as its data, its costs and its honesty. Look-ahead bias, overfitting and leaving out spreads and swaps all make results look better than live trading. Past performance is not a reliable indicator of future results, so always follow a backtest with a forward test on demo.

Can I backtest forex signals?

Yes, if the provider publishes a complete record including losses. Forexuro publishes every closed signal in its public trade history, so you can convert outcomes to R and compare exit plans yourself, as our study does.

Keep reading

Forex signals study: every closed signal analysed · From demo to live trading: when to switch · Trading expectancy calculator: edge per trade · Forex signals trade history, losses included