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.
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.
- 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.
- Data and setup. Choose the period, starting capital, slippage and brokerage. Stolo checks the strategy and shows which months have data before you run.
- Run. The backtest runs in the background, so you can close the tab. You see progress, a live equity curve and the engine log.
- 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.
| Time | What happens | Price |
|---|---|---|
| 09:19 | Candle closes; the strategy decides to enter | n/a |
| 09:20 | Order fills at the open | ₹100 |
| 09:41 | Candle opens at ₹128, high reaches ₹134 | stop level ₹130 touched |
| 09:41 | Stop 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.
| Cost | How it is treated |
|---|---|
| Brokerage | Standard F&O rate, or a flat amount per order you set |
| STT, exchange charges, SEBI fee, stamp duty, GST | Computed per fill from the dated rate table |
| Slippage | Against 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 mode | Behaviour |
|---|---|
| Same day | Closes at your exit time |
| N days | Held for up to 30 trading days |
| To expiry | Held 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.
Frequently asked questions
Why does my backtest enter at the open of the next minute?
What happens when a stop-loss and a target are both touched in the same minute?
What price does a stop-loss fill at?
Which costs are included?
What is slippage and what should I set?
Why were some days skipped?
How is position size and margin decided?
What do the hold modes mean?
What is a hold-out?
What is the difference between a plateau and a spike in the optimizer?
What do the robustness checks tell me?
How do entry conditions avoid looking into the future?
Can I backtest stocks, write code strategies or deploy a strategy?
Does a good backtest mean I will make money?
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
