Backtesting:
Definition, Software & Steps

What backtesting is, where to do it, how to start and why it matters, answered in four short panels.

1

What is backtesting?

Backtesting means running a trading strategy on historical market data to see how it would have performed, before you risk real money. You apply your entry, stop and exit rules to past prices and measure the result: win rate, risk-to-reward, drawdown and expectancy.

2

Where can I backtest a strategy?

Use software that replays real historical charts. FxBacktest runs in your browser with nothing to install: 105 instruments across forex, gold, indices, stocks, crypto and ETFs, every timeframe from M1 to monthly, free to start with no card.

3

How do you backtest a trading strategy?

Write your rules down, pick a market and a period, replay it candle by candle and place trades as if it were live, then read the report. Log about 100 trades on the lower timeframes before you judge the result.

4

Why backtest before trading live?

It shows whether a strategy has an edge, finds its flaws while a mistake costs nothing, and gives you the confidence to follow your rules when real money is on the line.

1.1 · DefinitionBacktesting definition: testing a strategy on the past

A backtest answers one question: if I had followed these exact rules over this stretch of history, what would have happened?

Backtesting is the process of applying a trading strategy to historical price data and recording every trade the rules would have produced. The strategy can be as simple as “buy the break of yesterday’s high with a stop under the day’s low” or as detailed as a multi-indicator system with session filters and news rules. What matters is that the rules are written down before the test and applied the same way to every trade.

The output is a set of numbers you can compare and improve: how often the strategy wins, how much it makes on a winner versus what it loses on a loser, and how deep the account falls before it recovers. Those numbers are what separate a strategy you believe in from one you only like the look of.

Manual and automated backtesting

There are two ways to run a backtest. Automated backtesting codes the rules into a script or expert advisor and lets software run them across years of data in seconds. Manual backtesting replays the market candle by candle while you make each decision yourself, as you would live. Manual replay is the better fit for discretionary and price-action strategies that cannot be reduced to code, and it trains the execution habits that automation skips. The trade-offs are covered in manual vs automated backtesting.

What a backtest measures

THE NUMBERS A BACKTEST GIVES YOU READ TOGETHER, NEVER ALONE
MetricWhat it tells you
Win rateHow often trades finish in profit
Risk-to-rewardAverage win compared with average loss
ExpectancyThe average result per trade, measured in R
Profit factorGross profit divided by gross loss
Maximum drawdownThe deepest fall from a peak, the number that decides whether you can stick with it

A 70% win rate means little if the average loser is three times the average winner, and a 35% win rate can be a strong system if winners run. That is why the metrics have to be read together; the guide on how to read backtest analytics walks through each one.

What a backtest cannot tell you

Past results do not guarantee future ones, and a backtest can mislead in predictable ways. Look-ahead bias creeps in when you let tomorrow’s candle influence today’s decision. Overfitting happens when you tune a strategy until it fits one stretch of history perfectly and nothing else. Ignored costs such as spread, commission and slippage turn a paper edge into a real loss. And a sample that is too small is just noise: see how many trades you need. The most common mistakes are listed in 9 forex backtesting mistakes.

2.1 · SoftwareBacktesting software: how to choose where to test

The tool decides how realistic your results are. Data quality, history depth and the way trades are filled matter more than the number of features.

COMMON WAYS TO BACKTEST WHAT EACH IS GOOD AT
OptionGood forWatch out for
SpreadsheetChecking simple rules on a small data setNo chart, easy to peek at the future by accident
Strategy tester in a trading platformFully automated, coded strategiesNeeds code, poor fit for discretionary trading
Charting platform with bar replayQuick manual replay on familiar chartsReplay limits and shallow history on lower plans
Dedicated replay backtesting softwareManual testing at scale with trade statisticsPick one with deep history and honest fills

What to look for

  • Real historical data for the markets you actually trade, with enough history to include trends, ranges and crashes.
  • Every timeframe, so you can test the same idea on M15 and H4 without switching tools.
  • Realistic fills and costs, because a strategy that only works at zero spread does not work.
  • A results report that gives you win rate, expectancy, profit factor and drawdown without a spreadsheet.
  • A price you can start at, ideally free, so you can test the tool as well as the strategy.

FxBacktest is built for manual replay in the browser. It covers 105 instruments, from forex pairs and gold to stock indices, single stocks, crypto and ETFs, with timeframes from M1 to monthly. The free plan replays recent history; the paid plans reach further back, and Ultra opens the full archive and tick data. Compare the options in the best manual backtesting tools or see how TradingView backtesting works.

3.1 · StepsHow to backtest a trading strategy in six steps

The process is the same on every market and timeframe. The discipline is in following it every time.

1
Write the rules

Define entry, stop, target and the conditions that allow a trade, in words, before you open a chart. If a rule is vague, the result will be too.

2
Pick market and period

Choose the instrument and a stretch of history that includes both trends and ranges. Do not choose a period because you know how it ended.

3
Replay candle by candle

Advance the chart one bar at a time so the future stays hidden. Make each decision on what you can see now, as you would live.

4
Place and manage trades

Enter with a stop and a target, size the position by risk, and take every setup the rules allow, including the ones that look ugly.

5
Log enough trades

Around 100 trades on M1 to H1, and at least 30 on H4 and above, before the numbers mean anything. Fewer trades is a sample, not a result.

6
Read the report

Check win rate, expectancy, profit factor and drawdown together. Change one rule, re-test on fresh data and keep a note of what you changed.

Two habits that keep the result honest

First, test on data you did not design the strategy on. If you build the rules on 2022, test them on 2019 and 2024 before trusting them; a strategy that survives different conditions is worth more than one that is perfect on a single year. Second, treat the backtest as a draft, not a verdict: follow it with a short forward test on a demo account to confirm the behaviour holds in live conditions, as described in how to forward test a forex strategy.

A full walk-through with screenshots is in how to backtest free online, and the question of how much history to use is answered in how far back to backtest.

4.1 · BenefitsThe benefits of backtesting before you trade live

A backtest will not make a strategy profitable. It tells you, cheaply, whether it is worth trading at all.

No money at risk

Every mistake in a replay costs nothing. You find out that a rule does not work before it costs you an account.

Evidence of an edge

Win rate, expectancy and profit factor over a real sample replace the feeling that a setup works with numbers you can check.

Flaws show up early

Backtesting exposes the losing streaks, the deep drawdowns and the market conditions where your strategy breaks, in advance.

Confidence to follow the rules

Most traders abandon a strategy during a drawdown. Knowing the strategy has survived worse in the past makes it easier to stay with it.

Years of experience, fast

A replay compresses months of market time into an evening, so you see hundreds of setups in the time live trading would show you a handful.

Better risk decisions

Your own maximum drawdown and losing streak tell you what position size you can actually live with, and whether a prop firm’s limits fit your strategy.

The strongest test is one the strategy cannot have been fitted to. FxBacktest’s strategy validation replays four hidden historical events, among them Brexit, COVID, the Ukraine invasion and the tariff shock, with blind dates, so you trade the conditions without knowing which one you are in. It is a harder and more honest check than a clean backtest on a quiet year.

Past performance is not a guaranteeBacktesting is a research method, not a forecast. Historical results do not predict future returns, and trading leveraged products involves a high risk of loss. Nothing on this page is financial advice.