Skip to main content

How Backtests Work in Stolo: Fills, Costs and Assumptions

A backtest is only as honest as its rules. Two platforms can run the same strategy on the same dates and report very different profits, because one fills at a price you could never get. This page spells out every assumption Stolo's backtester makes, so you know what the numbers mean before you rely on them.

info

Everything here is a simulation on historical data. Stolo does not place trades, and results are hypothetical: they were not achieved in a live account and do not predict future results.

The four steps​

Every backtest follows the same path, and each step has its own page in Stolo.

  1. Strategy. Pick a template or build your own: underlying, entry and exit time, legs, stop-loss, target and adjustments. Start from New backtest, then the builder.
  2. Data and setup. Choose the period, starting capital, slippage and brokerage. Stolo checks the strategy and shows which months have data before you run.
  3. Run. The backtest runs in the background, so you can close the tab. You see progress, a live equity curve and the engine log.
  4. Results. Overview, trade log, a minute-by-minute replay of any trade, and analytics. From there you can optimize, test robustness or compare runs.

Fills: no looking ahead​

Stolo decides on information that has already happened, then trades on the next price you could actually get.

  • Entries. "Enter at 09:20" means the decision uses the candle that closed at 09:19, and the order fills at the open of the 09:20 candle. The strategy never sees the 09:20 candle's own high, low or close.
  • Time exits. An exit at 15:15 fills at the open of the 15:15 candle.
  • Stop-loss and target. Checked against each candle's high and low, and filled at your level. If a candle opens beyond the level, which is what a gap does, the fill is at that open. If both a stop and a target are touched in the same minute, the stop wins, because one-minute data cannot say which came first.
  • Quiet minutes. If an option did not trade in the minute you wanted, Stolo looks a few minutes forward for a real trade. Exits on a quiet minute still happen, but they pay extra slippage.

A worked example​

You sell a NIFTY 24,500 call at 09:20 with a 30 percent stop.

TimeWhat happensPrice
09:19Candle closes; the strategy decides to entern/a
09:20Order fills at the open₹100
09:41Candle opens at ₹128, high reaches ₹134stop level ₹130 touched
09:41Stop fills at your level₹130

That is a 30 point loss per unit before costs. Had the 09:41 candle opened at ₹136, the fill would be ₹136 and the loss 36 points. The backtest gives you the second outcome too, which is why gap days hurt more than the stop distance suggests.

Costs and slippage​

Costs are applied to every fill, and the statutory rates are looked up by the date of the trade, so a 2023 trade pays the rates that applied in 2023.

CostHow it is treated
BrokerageStandard F&O rate, or a flat amount per order you set
STT, exchange charges, SEBI fee, stamp duty, GSTComputed per fill from the dated rate table
SlippageAgainst you on every fill; 0.5 points by default, adjustable

The results page shows where the money went: gross profit, then slippage, brokerage and taxes, ending at net profit. If a strategy only works with zero slippage, it does not work.

Capital, margin and skipped days​

Stolo estimates margin as a percentage of notional value. If that estimate is above your capital, the day is skipped rather than traded with money you do not have.

Other reasons a day is skipped, all listed on the results page with the date:

  • Option data is missing for that day.
  • A leg had no trade near the entry minute, or a bought hedge could not be filled.
  • The days to expiry were outside your filter.
  • Your entry condition never became true.
  • A day filter such as a large opening gap rejected it.

A run that skips most of its days is a warning, not a result.

How long a trade lasts​

Hold modeBehaviour
Same dayCloses at your exit time
N daysHeld for up to 30 trading days
To expiryHeld until the nearest leg expires, then settled at the official closing value

While a multi-day trade is open, no new trade starts.

Entry conditions and indicators​

You can make a strategy wait for a signal. Conditions combine comparisons such as above, below, crosses above and between, with all-of, any-of and not. They can use price, SMA, EMA, RSI, ATR, VWAP, Bollinger Bands, Supertrend, MACD, Stochastic, ADX, the previous day's high, low and close, the opening range, the opening gap and the time of day.

The rule that matters: a condition is checked at the close of each minute, and a 5, 15 or 60 minute indicator only changes when its candle has closed. At 09:23 a 5-minute RSI still shows the 09:15 to 09:19 candle. Entry happens on the next minute's open. In a strategy with more than one leg, you can also give a single leg its own condition: that leg then opens on the next minute's open after its condition is first true, as long as the other legs are still open.

Checking you have not fooled yourself​

The most common backtesting mistake is tuning a strategy until it fits the past. Stolo has four tools against it.

  • Hold-out. Reserve the last 20, 30 or 40 percent of the period on the setup step. The results show that stretch separately.
  • Optimizer. Sweep up to three named parameters, up to 500 combinations. Each result is labelled a plateau (neighbours do about as well) or a spike (neighbours do far worse). A top result that is a spike gets a warning.
  • Robustness. Walk-forward tunes on one stretch and tests on the next, over and over. Monte Carlo reshuffles your trades, and needs at least 10. Stress tests re-run with higher costs, late fills and shifted entry times. Together with the hold-out and the optimizer's stability these give a verdict of Robust, Reasonably robust or Fragile.
  • Compare. Put two to five runs side by side, with metrics, differences between their rules and how correlated their daily returns are.

Limits today​

  • NIFTY and BANKNIFTY options and futures only.
  • Code strategies, one-click deployment and stock strategies are not available yet.
  • Minute-level fills cannot be exported. Trades and the equity curve can.
  • One-minute candles, not ticks, so fills inside a minute are approximated from its high and low.
Stolo backtest setup step showing period, capital, slippage and hold-out

Frequently asked questions​

Why does my backtest enter at the open of the next minute?
A strategy that says enter at 09:20 decides using the 09:19 candle, which has closed by then, and fills at the open of the 09:20 candle. It never sees the high, low or close of the candle it is trading in. That is the same position you are in live, and it is what keeps a backtest from quietly using information it could not have had.
What happens when a stop-loss and a target are both touched in the same minute?
The stop wins. One-minute data cannot tell which was hit first, so Stolo takes the pessimistic reading and books the stop. If you would rather see how often this happens, filter the trade log by exit reason and look at the stopped trades.
What price does a stop-loss fill at?
At the stop level you set, when the minute's high or low reaches it. If the market gaps and the candle opens beyond your level, the fill is at that worse open price, not at your level. This is why a backtested stop can lose more than the stop distance on a gap day.
Which costs are included?
Brokerage, STT, exchange charges, SEBI fees, stamp duty and GST on every fill, plus slippage. Statutory rates are looked up by the date of each trade, so a 2023 trade uses the rates that applied in 2023. You can change the slippage and set a flat brokerage per order on the setup step.
What is slippage and what should I set?
Slippage is the gap between the price you expect and the price you actually get. Stolo applies it against you on every fill, 0.5 points by default. Liquid ATM options are often fine at 0.5 to 1 point; far out-of-the-money strikes deserve more. If a result only works with zero slippage, treat it as a warning.
Why were some days skipped?
A day is skipped when the strategy could not have traded it: option data is missing, a leg had no trade near the entry minute, the estimated margin was more than your capital, the days to expiry were outside your filter, or an entry condition never became true. The results page lists every skipped day with its reason.
How is position size and margin decided?
By default each leg trades the lots you set. Stolo estimates margin with a simple percentage of notional value and skips a day when that estimate is above your starting capital. You can also size by a percentage of capital or by risk per trade, which needs a defined-risk structure.
What do the hold modes mean?
Same day closes at your exit time. N days holds the position for that many trading days, up to 30. To expiry holds until the nearest leg expires and settles at that day's official closing value. A multi-day hold blocks new entries until it ends.
What is a hold-out?
It reserves the last 20, 30 or 40 percent of your period. The whole period still runs, but the results also show the final stretch on its own. If the strategy looks great before and poor after, it was probably tuned to the past.
What is the difference between a plateau and a spike in the optimizer?
A plateau is a good value whose neighbours do about as well: at least 75 percent of its score on average and none below half. A spike is a value whose neighbours average under 60 percent of it. Plateaus are believable, spikes are usually luck, and Stolo warns you when the top result is a spike.
What do the robustness checks tell me?
Four checks: walk-forward (tune on one stretch, test on the next), Monte Carlo (reshuffle your trades), parameter stability (from an optimizer sweep) and the hold-out. All pass means Robust, one failure means Reasonably robust, two or more means Fragile. You need at least two checks run before Stolo gives a label.
How do entry conditions avoid looking into the future?
Conditions are checked at the close of each minute. A 5-minute indicator only updates when its 5-minute candle has closed, so at 09:23 it still shows the 09:15 to 09:19 candle. Indicators available are SMA, EMA, RSI, ATR, VWAP, Bollinger Bands, Supertrend, MACD, Stochastic and ADX.
Can I backtest stocks, write code strategies or deploy a strategy?
Not yet. Stolo backtests NIFTY and BANKNIFTY options and futures built in the visual builder. Stock strategies, Python code strategies and one-click deployment are not available, and minute-level fills cannot be exported.
Does a good backtest mean I will make money?
No. A backtest is a simulation on past data. It leaves out things like queue position and sudden liquidity gaps, and a strategy tested many times will always find something that worked. Stolo labels every result as hypothetical for that reason, and does not place trades for you.

Test a strategy with honest assumptions

Start from a template, run it on years of one-minute data, and see where every rupee went.

Start with a Flexi Trial from ₹199