Skip to content

Backtesting

Running a backtest

The full walkthrough lives in Run your first backtest. This page covers what you do once that's familiar.

Reading the result panels

Summary stats

Stat What it means
Total return Final equity ÷ initial capital − 1, expressed as a %.
Annualised return The above, scaled to a full year. Useful for comparing runs of different lengths.
Max drawdown Largest peak-to-trough fall during the run, as a % of peak equity. The deeper this is, the more drawdown you'd have to stomach in live trading.
Sharpe ratio Risk-adjusted return. Above 1 is solid for retail, above 2 is unusually good — be sceptical and check for overfitting.
Win rate % of trades that closed profitable. Pair it with average win / loss size; a 30%-win strategy with big wins beats a 70%-win strategy with tiny wins.
Trade count Total number of round-trip trades. Very low (<20) means your stats are noisy; very high (>1000) on a daily strategy usually means an over-active rule.

Equity curve

The blue line is your portfolio value over time. Hover for the exact value on any date. If the curve dives steeply and recovers, that drop is your max drawdown.

Trade list

Each row is one round-trip trade:

  • Entry / exit — dates and prices
  • SideBUY (long) or SELL (short)
  • Quantity — number of shares/contracts
  • P&L — net of brokerage and slippage
  • Hold days — calendar days between entry and exit

Click a trade row to highlight it on the chart panel.

Compare

The Compare page (sidebar) puts two completed backtests side by side. Useful for:

  • Comparing two strategies on the same symbol/range
  • Comparing the same strategy with different parameters
  • Comparing the same setup across two symbols

The equity curves are normalized to a common starting point so you can read the shape, not the absolute capital.

Speed and the cache

The first backtest on a new symbol fetches historical data from Kite. We persist this in a local cache, so every subsequent backtest on that symbol — at any date range — uses the cache, not the network.

Expected timings:

  • First run on a new symbol: 1-2 seconds (one Kite call, ~300ms; rest is local computation)
  • Subsequent runs on the same symbol: 100-500ms

If a backtest is much slower than that, two common causes:

  1. Multiple concurrent backtests on different symbols — the rate limiter serializes Kite calls to stay within Zerodha's per-second cap. Wait a few seconds.
  2. Cold cache + many symbols — running a comparison on 8 fresh symbols means 8 sequential Kite calls + their data persisted. Re-running the same comparison will be near-instant.

Saving and exporting

Every backtest is saved automatically — see the Backtests sidebar for the full list. From the detail page you can export the trade list as CSV.