Skip to main content

Options Strategy Backtesting for NIFTY and BANKNIFTY

Stolo's backtest tool replays a multi-leg options strategy over historical market data and shows how it would have done. You build the legs, set the stop-loss and target, pick a date range and your capital, and the engine replays every session minute by minute, with costs included.

The problem it solves​

Most option strategies sound good in a WhatsApp group and fall apart in a drawdown you did not see coming. The only way to know how a rule set behaves is to run it over a few hundred sessions, including the bad ones. Doing that by hand in a spreadsheet is unrealistic.

The concept​

  1. Define the strategy, not a single trade. Legs, entry time, exit time, strike selection, stop-loss and target.
  2. Replay every day. For each session in the date range, the engine enters at your entry time, applies your rules minute by minute, and closes at your exit time, at expiry, or when a stop or target fires.
  3. Add up the results. Every trade feeds an equity curve and a set of risk statistics, after costs.

Step 1: build the strategy​

What you trade

  • Symbol: NIFTY or BANKNIFTY. Type to find FINNIFTY and MIDCPNIFTY.
  • Underlying price: from the cash index or the future. This sets the ATM strike and any stop based on the underlying.

When you trade

  • Entry and exit time: for example enter 09:20, exit 15:15.
  • Hold: the same day, or to expiry. A trade held to expiry settles at the close on the first leg's expiry, so the exit time is not used.
  • Trade on: the weekdays it may enter.

Each leg (up to six)

  • Segment and position: options or futures, buy or sell.
  • Option type and expiry: CE or PE. NIFTY options offer weekly, next weekly, monthly and next monthly; other symbols and all futures offer monthly and next monthly.
  • Strike selection: ATM, OTM, ITM, exact, percent of ATM, premium range, closest premium, premium greater than, straddle width, synthetic future, ATM straddle premium percent, closest delta, or delta range.
  • Lots.
  • Stop-loss and target: in points, underlying points, premium percent, underlying percent, or delta.

Which days it enters

Choose any day, only on expiry day, only the day before expiry, or a range of trading days before the first leg's expiry. The page names the days your choice picks. Weekends and holidays are not counted.

Step 2: choose dates and capital​

  • Period: pick a preset from 3 months to 2 years, or set your own dates.
  • Starting capital: a day is skipped if the estimated margin is more than your capital.
  • Slippage and brokerage: slippage defaults to 0.5 points per fill. Taxes and exchange charges are applied automatically, using the rates in force on each trade date.

Nothing is saved until you click Run backtest. You can go back and change anything first.

Key terms explained​

TermWhat it means
LegOne option or futures position in the strategy.
Strike selectionThe rule that picks each leg's strike, from ATM offsets to premium and delta targets.
Profit factorGross profit divided by gross loss. Above 1 is profitable.
Max drawdownThe largest fall in the equity curve from its previous peak.
Sharpe / Sortino / CalmarRisk-adjusted return ratios.
SlippageThe gap between the price you see and the price you get.

An example setup​

To test a NIFTY 9:20 short straddle with a stop:

  • Strategy: NIFTY, cash reference, enter 09:20, exit 15:15, same day.
  • Leg 1: sell CE, weekly, ATM, 1 lot, stop-loss 30 percent of premium.
  • Leg 2: sell PE, weekly, ATM, 1 lot, stop-loss 30 percent of premium.
  • Dates and capital: the last year, with your own starting capital.

Run it, then read the equity curve and the drawdown. Open the trade log to find the worst days, and use Replay to see exactly what happened on them.

How to use it in Stolo​

  1. Log in to Stolo and open Backtest from the main menu.
  2. Click New backtest, then pick a template or Build from scratch.
  3. Set the symbol, timing and legs, then click Next.
  4. Choose your dates, capital and costs, then click Run backtest.
  5. Watch it progress. It runs in the background, so you can leave the page.
  6. Read the results: Overview, Trade log, Replay and Analytics.
  7. Save the backtest to keep it, or Run again.
info

Backtesting is historical only. It does not connect to your broker or place any trades.

Limitations to know​

  • Index symbols only. No SENSEX, BANKEX or individual stocks yet.
  • One-minute bars, not ticks. Fills and stops are worked out from minute bars, so a real order could get a different price.
  • Same day or to expiry. Holding for a set number of days, and overnight BTST trades, are not available yet.
  • One trade at a time. A new trade does not start while one is running.
  • Results are hypothetical. Past performance does not guarantee future results.

Frequently asked questions​

What is options strategy backtesting?
Backtesting is running a defined strategy over historical market data to see how it would have performed. You set the legs, the entry and exit times, and the stop-loss and target for each leg. The engine then replays every trading day in your date range minute by minute and reports the result, without risking any capital.
Which instruments can I backtest in Stolo?
Index options and futures on NIFTY and BANKNIFTY, with FINNIFTY and MIDCPNIFTY available by typing the symbol. SENSEX, BANKEX and individual stocks are not covered yet.
Which expiries can I use?
NIFTY options offer weekly, next weekly, monthly and next monthly. Other symbols and all futures offer monthly and next monthly, because they have no live weekly expiry.
What kinds of strategies can I build?
Any strategy of up to six legs, mixing buy and sell, calls and puts, options and futures. Common examples are short straddles and strangles, iron condors, credit spreads and calendar spreads. You can start from a ready-made template or build from scratch.
How long can a trade be held?
Either the same day, from your entry time to your exit time, or to expiry, where the position is held until the first leg expires and settled at the close. Only one trade is open at a time, so days inside a running trade do not start a new one.
Can I trade only on certain days?
Yes. Choose the weekdays it may trade, and choose which days it enters relative to expiry: any day, only on expiry day, only the day before expiry, or a range of trading days before expiry. Weekends and holidays are not counted.
How accurate is the backtest?
The engine uses one-minute historical bars, not tick data. A trade decides on one minute's close and fills at the next minute's open. Stops and targets trigger on the minute's high or low, and if both are touched in the same minute the stop wins. Taxes and exchange charges use the rates in force on each trade date, and slippage is included. Results are hypothetical and do not guarantee future returns.
What does the backtest report?
Net profit and loss, return, CAGR, maximum drawdown, win rate, profit factor and Sharpe, Sortino and Calmar ratios, with an equity curve, costs breakdown and yearly results. The trade log lists every trade, and Replay steps through any trade minute by minute.
Does backtesting place any live trades?
No. Backtesting is entirely historical and touches nothing in your broker account.