Backtesting

Algo and options backtesting on historical NSE data

Before a strategy trades real money, run it over past market days and see every trade it would have taken — when it entered, why, at what price, and what it cost after charges.

TradeLayout backtests the same visual strategy you later paper trade and run live, so there is no second version of your logic to keep in sync.

Read the docs

What you can backtest

InstrumentUnderlyings
Index optionsNIFTY, BANKNIFTY, FINNIFTY, MIDCPNIFTY
Stock options (monthly expiry)RELIANCE, TCS, INFY, HDFCBANK, ICICIBANK, SBIN, WIPRO, HCLTECH, ITC, BHARTIARTL
Index futures & indexNIFTY, BANKNIFTY, FINNIFTY, MIDCPNIFTY
Stock futures & sharesRELIANCE, TCS, INFY, HDFCBANK, ICICIBANK, SBIN, WIPRO, HCLTECH, ITC, BHARTIARTL

The data is NSE tick data starting January 2024, extended as new trading days are added. If you choose an instrument there is no data for, the backtest is refused with a reason instead of quietly returning an empty result.

How trades are simulated

You choose between two execution modes for each run:

1-minute candles

The strategy is evaluated once a minute (and at the open). Futures and index orders fill at the next minute's open; option premiums come from the minute that just closed. If a stop and a target are both hit inside the same minute, the stop is assumed — the conservative choice. Fast, and good for exploring ideas.

Every tick

The strategy is evaluated on every second of market data and fills at that second's price — closer to how it behaves live, which matters for intraday options strategies with tight exits.

Intraday and positional strategies are both supported. A strategy with a carry-forward leg and no end-of-day exit is run day after day with its positions and state carried overnight; option legs still open on expiry day are closed at expiry.

Charges, slippage and tax

A strategy that looks good before costs can lose money after them, especially one that trades often. Reports can apply:

  • Brokerage — a ₹ amount per order you set
  • STT and exchange transaction charges
  • SEBI turnover fee and stamp duty
  • GST on the charges
  • Slippage — a % per fill you set
  • An estimate of income tax by taxpayer type

Each one is a switch in the report, so you can see exactly how much of the result each cost takes away.

Backtesting options strategies

For index and stock options, the strike and expiry of every leg are worked out at the moment of the trade, from the contracts that actually existed that day: ATM/ITM/OTM steps, the strike closest to a premium, or the strike closest to a delta, gamma, theta, vega or IV — and weekly, monthly or quarterly expiries.

That means a backtested short straddle sells the strikes that were at the money on each day, at the premiums those contracts traded at. How legs, strikes and expiries are set up is covered on the options strategy builder page.

A real NIFTY options backtest, start to finish

Here is one real run, summarised. The full walkthrough — the idea, the canvas, every day's result — is on the NIFTY short straddle worked example.

  1. The rule: at 09:20, sell the at-the-money NIFTY call and put of the nearest weekly expiry, 1 lot each. Exit both if the combined loss reaches ₹2,000, otherwise at 15:10.
  2. On the canvas: a time condition, two Entry nodes (Sell CE, Sell PE) and one exit check per leg — no code.
  3. The backtest: 20 Jul 2026 to 19 Oct 2026, 64 trading days, tick-level data, every charge switched on, no slippage added.
  • Before charges: +₹1,359
  • Charges on 256 orders: ₹8,044
  • After charges: −₹6,685
  • Profit / loss days: 36 / 28; stop hit on 25 days

It made money before costs and lost money after them. That is exactly what a backtest is for: finding out before real money does. Why live results can differ again is covered in backtest vs live trading.

What the report shows

  • Total and net P&L, win rate, profit factor, expectancy, payoff ratio
  • Maximum drawdown, best and worst day, average winning and losing day
  • Equity curve, drawdown chart and monthly P&L
  • A calendar of daily results
  • Every trade, with entry and exit prices and times
  • A per-node decision trace: which condition fired, and when

Results can be saved as a .tlr file and reopened later. The backtest results guide walks through each part.

Reading a backtest honestly

A backtest tells you how a set of rules behaved in the past. A few habits make it more useful:

  • Turn on costs and slippage before judging a strategy, not after.
  • Look at the number of trades. A high win rate over a dozen trades says very little.
  • Check drawdown and the worst day, not just total P&L — they decide whether you could live with it.
  • Be suspicious of tuning. If a strategy only works with one exact parameter value, it has probably been fitted to the past.
  • Paper trade it on live prices before going live. See automated trading and why live results differ.

Current limitations

What this does not do today, so you can decide before you sign up:

  • Historical data starts in January 2024; earlier years can't be tested.
  • SENSEX/BANKEX options, options on stocks outside the ten listed, and MCX contracts cannot be backtested yet.
  • Stock options have monthly expiries only; a weekly expiry on a stock is not available.
  • Fills use the traded prices in the data; there is no order-book depth or market-impact model.
  • Corporate actions and dividends are not modelled.
  • Statutory charges use the latest published rates, not the rates in force on each historical date.
  • Backtests run one strategy at a time; there is no portfolio or multi-strategy backtest.

Questions

How far back can I backtest?

To January 2024, the start of the platform's historical data, up to the previous trading day.

Which instruments can I backtest?

NIFTY, BANKNIFTY, FINNIFTY and MIDCPNIFTY options, futures and index; and the options, futures and shares of ten large-cap NSE stocks. See the table above.

Should I use 1-minute or every-tick mode?

Use 1-minute mode to explore quickly. Use every-tick mode before you rely on a result, especially for intraday options strategies whose exits trigger within a minute.

Are brokerage and taxes included?

Yes, as switches in the report: brokerage, STT, exchange charges, SEBI fee, stamp duty, GST, your slippage percentage, and an income-tax estimate.

How many backtests can I run?

It depends on your plan; 1-minute runs and tick-level runs are counted differently. Current limits are in the pricing section.

Does a good backtest mean the strategy will make money?

No. It shows how the rules behaved on past data, under the execution assumptions above. Markets change, and live fills differ from simulated ones.

Try it on your own idea

Sign up free, build the strategy on the canvas, and backtest it before you connect a broker. Trading involves risk of loss; a backtest is not a promise of future results — see the risk disclaimer.

See pricing