How a backtest works
- Write exact rules: entries, exits, size and costs.
- Choose a period of historical data, ideally including calm and volatile markets.
- Replay the data day by day, applying the rules as if trading live.
- Record every trade and summarise the results.
What a backtest reports
| Metric | Meaning |
|---|---|
| Net P&L | Profit or loss after costs |
| Win rate | Share of trades that made money |
| Maximum drawdown | Largest fall from a peak in the running total |
| Profit factor | Gross profit divided by gross loss |
| Average trade | Net P&L divided by the number of trades |
Our guide to backtest performance metrics explains how to read each one.
An example
What makes a backtest misleading
- No costs: brokerage, STT and slippage can turn a profitable test into a losing strategy.
- Look-ahead bias: rules that use information not available at the time, such as the day's close at 10 am. See look-ahead bias.
- Overfitting: tuning rules until they fit the past perfectly, so they fail on new data. See avoiding overfitting.
- Too short a period: a few calm months can hide the days that matter.
- Changed rules: lot sizes, expiry days and margins change. Nifty's lot was 75 before the January 2026 series and is 65 from it.
Backtesting and forward testing
A backtest shows the past. Paper trading, also called forward testing, runs the same rules on live prices with virtual money. Using both, in that order, catches most problems before real money is at risk. Our guide to backtesting vs forward testing compares them.
Related terms
Learn more
- How to backtest trading strategies
- Common backtesting mistakes
- QuantPower backtest tutorial
- Backtesting in QuantPower
Frequently asked questions
Does a good backtest mean a strategy will make money?
No. It shows the rules would have worked in the past under the assumptions used. Markets, costs and rules change.
How much history should a backtest use?
Enough to include different market conditions. For intraday option strategies, a year or more is a sensible minimum.
Should a backtest include costs?
Always. Include brokerage, statutory charges and slippage.
