Skip to content

Strategy backtesting

Backtesting that charges what your broker would

Replay a strategy over historical candles on the timeframe it trades, and see what it would have made after costs — not before them. Indian F&O backtests pay Zerodha's full rate card on every order, and intraday rules are applied the way a real account applies them.

Costs that a percentage can't express

Most backtesters subtract a flat percentage. Indian derivatives aren't charged that way, so for Indian F&O every executed order pays Zerodha's per-order rate card:

  • Flat brokerage per order
  • Securities Transaction Tax (STT)
  • Exchange transaction charges and SEBI turnover fees
  • Stamp duty
  • GST on brokerage and charges

Crypto backtests pay the futures taker fee on every fill, entries and exits alike, because every backtest fill is a market order.

Rules applied to every test

  • No look-ahead: a strategy only reads candles that had closed before the bar it is deciding on, including on higher timeframes.
  • Intraday square-off for Indian sessions: open trades are closed at the square-off time and no new entries are taken after it — an intraday position cannot be carried overnight.
  • Leverage (crypto): isolated margin; a long is liquidated when price reaches entry × (1 − 1/leverage), losing its margin. Maintenance margin and funding are not modelled, so real liquidations come slightly earlier.

Set up a backtest

  • Period: 1 day, 3 days, 1 week, 1, 3 or 6 months, 1 year, or a custom date range.
  • Instruments: indices, stocks, options and crypto.
  • Position size: a fixed quantity, or a fixed amount of funds per trade.
  • Crypto leverage: up to 100x on BTC and ETH, 20x on other pairs.

Read the results

Each run shows an equity curve, the list of trades and these figures:

  • Total P&L
  • Fees paid
  • Win rate
  • Total trades
  • Funds or margin used
  • Max drawdown
  • Average win
  • Profit factor

Fees are shown separately, so you can see how much of a strategy's edge the charges take.

From backtest to paper trading

A good backtest is a reason to keep testing, not to go live. Run the same strategy in Demo on live prices — see how paper trading works — and compare its paper results with the backtest before risking money.

What a backtest cannot tell you

A backtest shows how a set of rules would have behaved on past data. It does not include slippage beyond the modelled costs, and a strategy tuned until its backtest looks good often fails on new data. Read the risk disclosure, and see the FAQ for more.

Start on paper today

Free account · Demo and Manual trading on virtual balances from day one.

Create a free account