Backtesting trading strategy:
Free tool
Backtesting a trading strategy is how you find out whether an idea has an edge before it costs you real money. Done loosely it just confirms what you already hoped; done properly it gives you a win rate, an expectancy, and a drawdown you can actually trust. Here is the step-by-step process — and the free tool to run it.
To backtest a trading strategy means to run its rules across historical price and record what would have happened — enough times that the result is a measurement, not an anecdote. The goal is a sample large and honest enough that the numbers reflect the strategy, not luck and not your bias. Five steps get you there.
Step 1 — Write the rules down first
Before you look at a single chart, define the strategy precisely: what triggers an entry, where the stop goes, where the target goes, and what closes the trade early. If the rules live only in your head, you will unconsciously bend them to fit each chart and the backtest becomes worthless. Written rules make every trade repeatable — the whole point of testing properly.
Step 2 — Choose the instrument and timeframe
Test the strategy on the market and timeframe it is actually meant to trade. A scalping rule set belongs on M1–M15; a swing strategy belongs on H4–D1. Load real historical data for that instrument — and if the strategy is meant to be general, plan to repeat the test on a few different markets rather than assuming one result transfers.
Step 3 — Replay the chart and take every trade
Step the chart forward one bar at a time and take every trade your rules allow — including the ugly ones you would rather skip. This is where most backtests go wrong: quietly passing on the setups that "didn't feel right" inflates the win rate and hides the strategy's real behaviour. Bar-by-bar manual backtesting keeps you honest because you can't see the future bars.
Step 4 — Build a large enough sample
A handful of trades proves nothing. Aim for at least 50–100 trades across different conditions — trends, ranges, quiet and volatile periods — so a couple of lucky winners can't carry the result. This is exactly why manual backtesting beats waiting for live trades: you can build a 60-trade sample in an afternoon instead of a year.
Step 5 — Read the metrics together, not win rate alone
Win rate in isolation is the most over-weighted number in trading. Read the full picture:
- Win rate + risk-reward — a 40% win rate at 1:2 is profitable; a 60% win rate at 1:0.5 is not.
- Expectancy — the average dollar (or R) you make per trade; this is the real edge.
- Profit factor — gross profit divided by gross loss; above ~1.3 is a decent start.
- Max drawdown — the deepest the account fell; the pain you have to survive to collect the edge.
A good backtester computes all of these for you and draws the equity curve, so you read the strategy the way a risk desk would rather than tallying a spreadsheet by hand.
Backtest a strategy free
FxBacktest runs the whole process in the browser for free. Pick an instrument and timeframe, replay the chart bar by bar, place buy and sell trades with draggable stop and target, and the lot is auto-sized to a fixed risk percentage. Every trade is logged, and the end-of-session report totals your win rate, expectancy, profit factor, and drawdown automatically — no Pine Script, no download, no card. It works for a discretionary strategy that a code-only tester can't measure.
- 105 symbols
- 9 timeframes
- 86 indicators
- 28 backtest analytics
- Custom bar replay
- Compare symbols
- AI scripting
- Strategy optimization
- Pattern game
- Economic calendar
- Community backtests
- Multi-strategy stats
- MT5 EA analytics
- Free course
- Trade journal + tags
- Prop firm challenges
- 7 candle types








A worked example: 60 trades on EURUSD H1
Abstract steps are easy to nod along to, so here is the same process with numbers attached. The strategy: buy the pullback to the 20 EMA in an uptrend, stop below the swing low, target twice the stop distance.
- Sample: 60 trades on EURUSD H1, spanning a trending stretch, a choppy range, and one high-volatility news week.
- Result: 24 winners, 36 losers — a 40% win rate, which sounds like failure until you read it beside the risk-reward.
- The maths: at 1:2, the 24 winners return 48R and the 36 losers cost 36R. Net +12R across 60 trades.
- Expectancy: 12R divided by 60 trades = +0.2R per trade. Risking 1% per trade, that is roughly 0.2% of the account earned per trade taken.
- Max drawdown: a run of 7 straight losses mid-sample took the equity curve down 7R. That is the number that decides whether you can actually trade this.
Note what the sample exposes that a 10-trade test would have hidden entirely: the seven-loss streak. A strategy with a positive expectancy you cannot psychologically survive is not a tradable strategy, and only a large enough sample surfaces that.
What a good backtest result actually looks like
There is no single passing grade, but these ranges separate a result worth forward-testing from one worth discarding.
| Metric | Weak | Worth testing further | Strong |
|---|---|---|---|
| Sample size | Under 30 trades | 50-100 trades | 200+ trades |
| Expectancy | Negative or ~0R | +0.1R to +0.3R | Above +0.3R |
| Profit factor | Below 1.0 | 1.3 to 1.6 | Above 1.6 |
| Max drawdown | Deeper than you would sit through | Under 15% of account | Under 10% of account |
| Longest losing streak | Unknown - sample too small | Measured and survivable | Measured and comfortable |
Be suspicious of results that look too good. A profit factor above 3 on a small sample almost always means the rules were bent, the sample was cherry-picked from a single favourable regime, or the strategy was curve-fitted to the data you tested on.
Manual vs automated backtesting a strategy
Both approaches answer the same question, but they suit different rule sets — and picking the wrong one wastes weeks.
- Automated suits fully mechanical rules with no judgement calls. You write the strategy in code, run it across years of history in seconds, and can optimise parameters quickly. The catch: it only tests what you can express in code, and fast optimisation makes curve-fitting almost effortless.
- Manual suits discretionary rules — anything involving structure, context, or "only in this kind of market". You replay the chart bar by bar and cannot see the future, so the test reflects the decisions you would genuinely have made in the moment.
Most retail strategies are partly discretionary even when the trader believes they are mechanical. If you cannot hand your rules to a stranger and have them take the identical trades, the strategy has judgement in it and needs manual testing.
Five mistakes that make a backtest worthless
- Skipping the ugly setups. Passing on trades that "obviously" would have lost is the single most common way traders inflate a win rate without noticing.
- Seeing the future bars. Scrolling a static chart lets your eye register what happened next. Bar-by-bar replay is the only way to remove this.
- Testing one market regime. A trend-following strategy tested only across a clean trend will look extraordinary and then fail the moment the market ranges.
- Ignoring costs. Spread and commission turn many marginal scalping edges negative. A backtest without costs applied measures a strategy you cannot actually trade.
- Re-tuning mid-sample. Adjusting the rules halfway through because the results disappoint means your sample now tests two different strategies, and neither honestly.
Measured: why the years you test decide the answer
The most common way a backtest lies is not a coding error — it is testing a single volatility regime and reading the result as a permanent property of the strategy. Here is the size of that effect, measured on 3,440 EURUSD daily bars:
| Year | EURUSD avg daily range | vs. the 11-year mean | GBPUSD |
|---|---|---|---|
| 2015 | 107 pips | +51% | 107 pips |
| 2016 | 79 pips | +11% | 131 pips |
| 2019 | 47 pips | -34% | 88 pips |
| 2021 | 54 pips | -24% | 79 pips |
| 2022 | 88 pips | +24% | 116 pips |
| 2024 | 53 pips | -25% | 68 pips |
| 2015-2025 mean | 71 pips | — | 95 pips |
EURUSD's average day was 107 pips in 2015 and 47 pips in 2019 — the same instrument, less than half the movement. A breakout strategy tested only on 2015 looks excellent; the identical rules on 2019 barely clear the spread. Neither result is wrong, and neither is the strategy's true expectancy.
Three rules follow directly from this:
- Never test one continuous recent window. Split the sample across a high-volatility year and a low one and compare the two reports separately, not merged.
- Watch the pair, not just the strategy. 2016 was quiet for EURUSD (79 pips) and the loudest year in the decade for GBPUSD (131 pips, the Brexit referendum). Portfolio results hide this; per-instrument results expose it.
- Report the range, not a single number. "Profit factor 1.4" means little. "Profit factor 1.9 in 2015, 1.1 in 2019" is a strategy you can actually plan around.
Regulators make the same point about simulated results in general — see the CFTC rule cited below, which requires hypothetical performance to carry a warning that such programs are "designed with the benefit of hindsight". That is precisely the failure mode a single-regime backtest produces.
Computed 2026-08-27 from the FxBacktest tick-derived OHLC archive: 3,440 EURUSD and 3,438 GBPUSD daily bars, 2015-2025. "Avg daily range" is the mean of each day’s high minus low, in pips.
Measured: the baseline your result has to beat
Step 5 says to read the metrics together. There is one more number to read them against: what a random entry would have scored. We ran fourteen classic indicator signals across 93 instruments and 16 years of daily charts, each with a 1.5×ATR stop and a 1:1 target, and gave every signal a random twin with the same direction and the same stop.
| Entry (daily, 1:1 target) | Trades | Win rate | Random twin | Real edge |
|---|---|---|---|---|
| MACD bullish cross | 10,069 | 52.6% | 52.0% | +0.6 pts |
| RSI(14) exits oversold | 2,936 | 52.2% | 51.1% | +1.1 pts |
| Golden cross (EMA 50/200) | 780 | 52.4% | 53.0% | −0.6 pts |
| Close below lower Bollinger | 7,102 | 52.0% | 51.6% | +0.4 pts |
| Any random long | — | 51.8% | — | — |
| Any random short | — | 46.6% | — | — |
- A long strategy at 52% has not shown you anything yet. Random longs won 51.8% over this period because indices, gold and crypto rose. Every long rule inherits that for free.
- Most real edges were under two points. The best daily result in the whole study was +3.0 points (RSI oversold at a 1:2 target).
- The fix costs nothing: after your backtest, take the same number of trades at random bars with the same stop and compare. If the gap is inside your sampling error, you have no edge to trade.
Source: do trading indicators actually work? — 1,022,716 signals, Dukascopy bid OHLC, 93 instruments, 2010 to August 2026. Ties between stop and target are scored as losses; five random draws per signal.
Backtesting a strategy — FAQ
How many trades do I need to backtest a strategy?
Aim for at least 50 to 100 trades across different market conditions before you trust the numbers. Fewer than that and a couple of lucky winners can make a losing strategy look profitable. The more trades in the sample, the more reliable the win rate and expectancy become.
What metrics matter most when backtesting a trading strategy?
Win rate on its own is misleading. Read it beside risk-reward, expectancy (average profit per trade), profit factor, and maximum drawdown. A strategy with a 40% win rate at 1:2 risk-reward is profitable; a 60% win rate at 1:0.5 is not. Expectancy and drawdown together tell you whether the edge is real and survivable.
Can I backtest a trading strategy for free?
Yes. FxBacktest is a free browser-based backtester: replay historical charts bar by bar, place manual trades with stop and target, and get a full report of win rate, expectancy, and drawdown — no download, no code, and no credit card required.
How long does it take to backtest a trading strategy?
A 50 to 100 trade sample on an hourly chart typically takes two to four hours of focused chart replay. That is dramatically faster than forward testing the same strategy live, which would take months to produce the same number of trades.
How far back should I backtest a strategy?
Far enough to cover several different market conditions rather than a fixed number of years. One to two years of data on an intraday timeframe usually spans trending, ranging, quiet, and volatile periods. Testing only the most recent few months risks measuring a single regime that will not repeat.
What is the difference between manual and automated backtesting?
Automated backtesting runs a strategy written in code across history in seconds, but only works for fully mechanical rules. Manual backtesting means replaying the chart and taking each trade by hand, which is the only honest way to test a discretionary strategy where judgement is part of the entry.
Sources
- 17 CFR § 4.41 — CFTC rule on hypothetical performance — the US regulation governing how simulated results must be presented, and the source of the standard warning that simulated programs are "designed with the benefit of hindsight".
- NFA Compliance Rule 2-29 — communications with the public — the National Futures Association rule on promotional material and hypothetical results.
Data from Dukascopy