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.
Beware curve-fitting and look-ahead bias: if you tweak the rules after seeing the result until the equity curve looks perfect, you have fitted the strategy to the past, not found an edge. Test the rules as written, then change them once and re-test on fresh data — never mid-sample.
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, no code
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.
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.
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.