Free trial
Menu
Glossary

What Is a Backtest?

A backtest runs a trading strategy's rules over past market data to show how it would have performed: every trade, the profit or loss after costs, and the drawdowns along the way.

QuantPower Research · Updated 6 Nov 2026 · 2 min read

How a backtest works

  1. Write exact rules: entries, exits, size and costs.
  2. Choose a period of historical data, ideally including calm and volatile markets.
  3. Replay the data day by day, applying the rules as if trading live.
  4. Record every trade and summarise the results.

What a backtest reports

MetricMeaning
Net P&LProfit or loss after costs
Win rateShare of trades that made money
Maximum drawdownLargest fall from a peak in the running total
Profit factorGross profit divided by gross loss
Average tradeNet P&L divided by the number of trades

Our guide to backtest performance metrics explains how to read each one.

An example

Example
A Nifty short straddle is tested from January 2025 to September 2026 with brokerage of ₹20 per order, statutory charges and one point of slippage per order. Each trade has four orders: two entries and two exits. If slippage turns out one point worse per order live, each trade costs another 4 × 65 = ₹260, so a strategy whose average trade is ₹300 has almost no margin for error.

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.

Learn more

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.

Backtest results are hypothetical and do not guarantee future returns. Trading involves substantial risk.