Definition
Backtesting is the process of applying a fully specified trading or investment rule to historical data to see how it would have behaved, including its returns, losses and trading frequency. It is a research tool for studying a rule, not evidence that the rule will work in the future.
How it works
A sound backtest fixes the rules before looking at results, uses only data that was available at each simulated date, includes realistic costs, and records trades, drawdowns and time spent below previous peaks as well as average return. The test universe, data frequency, order timing and position sizing must all be stated.
A single backtest is one historical path, so it is best treated as a check on a hypothesis. Results should be examined on separate out-of-sample data and across different market regimes before drawing even tentative conclusions.
Illustrative example
Illustrative: a fictional rule holds an index fund when its close is above its 200-day average and otherwise holds cash. Over 10 years it makes 18 round trips (1.8 a year) and earns 7.0% a year before costs; at 0.30% per round trip, costs are 1.8 × 0.30% = 0.54% a year, leaving about 6.5% a year.
What to watch for
Backtests flatter reality when they contain look-ahead bias, survivorship bias, ignored costs or over-tuned parameters, and strong historical results can disappear in live use. Treat results as educational evidence about past behavior only, never as a forecast.