Register
Glossary

What Is a Backtest?

A backtest runs a strategy's rules over past market data to show every trade, the profit or loss after costs, and the drawdowns along the way. It answers one question, what those exact rules would have done if they had been followed on those days, and it shows how steady the results were, so you can judge a strategy before it trades with real money.

QuantPower Research · Updated 12 Nov 2026 · 7 min read

A backtest is not a forecast. It shows how a set of rules behaved on one stretch of history, with the costs and fills you assumed. Used well, it removes strategies that never worked; used badly, it can make a weak strategy look strong.

How a backtest works

Every backtest follows the same steps:

  1. Write the rules exactly. Entry, exit, stop, size and the days it trades. A rule the computer cannot check without judgement cannot be tested.
  2. Choose the data and the period. The instrument, the candle size (for example 5-minute or daily) and the dates.
  3. Apply the rules candle by candle. The test acts only on information available at that moment, opens and closes positions, and records each trade.
  4. Deduct costs. Brokerage, STT, exchange charges, stamp duty, GST and an allowance for slippage.
  5. Summarise. Net and gross profit or loss, win rate, average win and loss, maximum drawdown, the longest losing run and results by month.

A worked example

A trend rule on Nifty futures buys when the 20-period EMA crosses above the 50-period EMA on 15-minute candles, with a stop of 0.5% and a target of 1%, one lot of 65.

Suppose the backtest finds 20 trades over the test period, with a gross profit of ₹30,000 before costs. A Nifty futures round trip at 25,000 costs about ₹966 at ₹20 an order and the rates in force from 1 April 2026, so 20 trades cost about ₹19,320. The net result is ₹10,680, about a third of the gross.

MeasureValue
Trades20
Gross profit₹30,000
Charges (about ₹966 a round trip)₹19,320
Net profit₹10,680

Charges took nearly two-thirds of the gross. Had the test ignored them, the rule would have looked three times better than it was. A slippage allowance of even a few points per trade would cut the net further.

What a backtest can and cannot tell you

It can showIt cannot show
Whether the rules made money on past data after costsWhether they will make money next month
The worst drawdown the rules producedHow you will feel sitting through it with real money
How results changed from year to yearHow the rules behave in a market type the data never contained
How sensitive the result is to small changesFills on thin strikes or during exchange outages

Common traps

  • Look-ahead bias: using information that was not known at the time, such as a candle's close before the candle has closed.
  • Overfitting: adjusting the rules until they fit the past period perfectly. The fit rarely carries over to new data.
  • A convenient period: testing a short-selling rule only on a falling year.
  • Ignoring costs: the example above shows how much they matter.
  • Ignoring rule changes: Indian index derivatives changed lot sizes, expiry days and STT between 2024 and 2026, so older results describe a slightly different market.

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

Rule backtests and option strategy backtests

The word covers two quite different tests.

  • A rule backtest checks a condition on one instrument, such as an indicator crossing a level on Nifty futures or a stock. The test reads past candles, opens one position when the condition is met and closes it on a stop, a target or an exit rule. Its weak point is the candle size: on 15-minute candles it cannot tell what happened inside each candle.
  • An option strategy backtest checks a set of option legs, such as a short straddle with a stop on each leg. For each past day it picks each leg's strike at the entry time, prices the legs through the session and closes them at the exit time. Its weak point is the option data: thin strikes and expired contracts must be priced realistically for the result to mean anything.

Both need the same discipline: fixed rules, realistic costs, a long enough period and a check on days the rules were not built on.

A second example: what one setting can do

A short straddle tested over a year with a 30% stop on each leg shows a net result of ₹42,000 after costs. The same rules with a 25% stop show ₹9,000, and with a 35% stop a loss of ₹6,000. Nothing about the market changed; only one number did.

That spread of results is the real finding. A strategy whose result swings from a gain to a loss when one setting moves by five percentage points depends on that exact setting, and the next year's market is unlikely to reward that exact setting again. A sturdier rule gives broadly similar results across nearby settings, even if none of them is the single best figure in the test.

How to read a backtest in five minutes

  1. Look at the net result after costs, not the gross.
  2. Find the maximum drawdown and ask whether you would have kept trading through it.
  3. Check the results by month or year. A result that comes from two good months depends on those months returning.
  4. Open a few trades from good and bad days and check they follow the rules as you meant them.
  5. Change one setting a little and run the test again. If the result collapses, treat it as fragile.

Backtest, forward test and live trading

BacktestForward testLive trading
PricesPast dataLive pricesLive prices
MoneyNoneTest moneyReal money
OrdersSimulatedSimulated, no order reaches a brokerReal orders to your broker
Time neededMinutesWeeksOngoing
What it catchesRules that never workedFills, spreads and sessions that differ from the testEverything, at real cost

Each step catches problems the one before cannot. A strategy should pass a backtest, then a forward test on live prices, and only then go live with the smallest size.

What data a backtest needs

  • Prices at the right frequency. Intraday rules need intraday candles; a rule that enters at 9:20 am cannot be tested on daily candles.
  • Option prices for each leg, not just the index, for an option strategy.
  • The contract rules of the time: lot sizes, expiry days and tick sizes as they were on each date.
  • Costs as they were, or at least as they are today, applied to every trade.

A short history

Traders tested rules on past prices long before computers. In the 1950s and 1960s, Richard Donchian worked out trend rules for commodity futures by hand from price charts. Computers made the routine fast in the 1970s and 1980s, and personal-computer trading software brought it to individual traders.1 Testing also exposed its own traps: in 1992 Robert Pardo described walk-forward analysis, which builds rules on one stretch of data and tests them on the next, as a guard against overfitting.2

Backtests in QuantPower

QuantPower runs two kinds of backtest:3

  • Rule backtests test a condition on one instrument, on your broker's own candles from 5-minute to daily, up to 2,000 candles a run. They hold one position at a time and include a stop, a target, an exit rule, slippage and an estimate of charges.
  • Option strategy backtests test a set of option legs day by day, minute by minute: each leg picks its strike at the entry time, is checked against its own stop and target every minute, and closes at the exit time. Charges are deducted leg by leg.

Every option strategy report holds back the last 30% of the days and compares them with the first 70%, a quick check against overfitting. A backtest costs 2 tokens a run, and the first 10 each week are free. The next step after a backtest is Forward test on live prices with test money. The full details are on the backtesting page.

Frequently asked questions

How long a period should a backtest cover?

Long enough to include rising, falling and quiet markets, and recent enough to reflect today's lot sizes, expiry days and taxes. Many traders test at least a year and split the result by year to see whether it holds.

Is a backtest the same as paper trading?

No. A backtest runs the rules on past data in minutes. Paper trading, which QuantPower calls Forward test, runs them on live prices as the market moves, with test money and no real orders.

Why do live results differ from a backtest?

Fills, spreads, slippage, broker sessions that expire and orders that are refused all affect live trading. A backtest can only approximate them, which is why a forward test on live prices comes next.

References

  1. Michael W. Covel, *The Complete TurtleTrader* (2007), on Richard Donchian's rule-based trend following
  2. Robert Pardo, *Design, Testing and Optimization of Trading Systems* (1992), on walk-forward analysis
  3. QuantPower: backtest engine, limits and prices, from the app's product notes and price list, checked 12 November 2026
Backtest results are simulated on past data and do not guarantee future results. Trading involves substantial risk, and this page is not investment advice.