Guide · Systematic

How to backtest a trading strategy in India

The short answer

A backtest is an experiment, and most retail backtests fail as experiments long before they fail as strategies. The design is broken, not the idea. An experiment needs four things fixed before the data is opened: a hypothesis, a protocol, controls, and a decision rule that can return no. Get those right and the answer carries information even when it disappoints. Get them wrong and no amount of history, software or computing power can rescue the result, because you were never testing anything.

This is the practical guide: the data you actually need and the three places Indian retail data is genuinely weak, the order the steps must happen in, the arithmetic of costing a round trip with rates verified as of 18 July 2026, what to measure once the run finishes, and the discipline of stopping. It is deliberately a procedure rather than a warning list. The catalogue of specific ways a backtest deceives you, look-ahead through survivorship to execution fantasy, is a separate subject with its own page: the eight ways a backtest lies. Read that one for the failure modes. Read this one to run the thing properly in the first place.

A backtest is an experiment, not a report

The word "backtest" makes it sound like a measurement, something you perform on a strategy the way you weigh a parcel. That framing is the root defect. A backtest is an experiment, and an experiment is defined by its structure rather than its result. If you cannot say in advance what outcome would make you abandon the rule, you are not running an experiment. You are generating a picture and then deciding how to feel about it.

The distinction has teeth because of a specific asymmetry. A trading rule has many free parameters: the lookback, the threshold, the stop distance, the holding period, the universe, the date range. Historical data has a great deal of noise. Given enough freedom over the parameters and enough looks at the same history, you can always find a combination that produced a pleasing curve, and you can always find it whether or not the rule has any edge at all. That is not a risk of the method, it is a guarantee of it. The only thing standing between you and a beautiful, meaningless result is a structure you imposed before you started looking.

So the discipline is front-loaded. Almost everything that determines whether your answer means anything happens before the first bar is processed, and almost none of it involves software. The figure below puts the two processes side by side, because seen together the defect in the common one is obvious in a way it never is from inside.

An experiment has an exit condition fixed in advance; the retail loop exits on the result A designed experiment runs in one direction and can end in rejection. The retail loop cycles through tweaks until the output is satisfying, which guarantees a satisfying output regardless of whether the rule has any edge. Two ways to run the same test The difference is not the software. It is where the stopping rule lives. A designed experiment stopping rule written before the data is opened Hypothesis this rule has positive expectancy net of costs Protocol data, window, costs and split fixed in advance Controls point-in-time universe, adjusted prices, real fills Decision rule the thresholds that mean pass, declared now accept reject The retail loop stopping rule discovered inside the output Idea a pattern noticed on a chart Test run it over whatever history is loaded Not good enough judged against nothing declared Tweak and retest move a parameter, run it again until it looks good ship it The right-hand panel has no failure state. A process that cannot return “no” is not testing anything.
The exit condition is the whole argument. Both panels use the same data and the same code. The left one can end in rejection, so a pass carries information. The right one exits when the output becomes satisfying, so it always ends in a pass, and a result that could never have been anything else tells you nothing about the rule. Note the asymmetry: the left panel is slower and frequently returns a disappointing answer, which is precisely why its answers are worth having.
The test for whether you are running an experiment. Write down, right now, before you touch the data, the numbers at which you would abandon this rule. A minimum trade count. A worst acceptable drawdown. A minimum expectancy net of costs. If you cannot write them down, it is because you intend to decide after seeing the result, and a threshold set after the fact is not a threshold. It is a description of whatever you got.

The data comes first, and Indian retail data is weak in three specific places

Every backtest is a claim about what would have happened, and it inherits every flaw in the record it reads. In India the free and cheap datasets most retail testers use are weak in three places specifically, and each weakness biases results in the same direction: toward flattering them. Knowing which three lets you either fix them or, at minimum, state honestly how much of your result is an artefact.

The first is corporate action adjustment. Indian exchanges publish the traded price, and the traded price mechanically drops on the ex-date of a split, bonus or rights issue while shareholder wealth is unchanged. An unadjusted series therefore contains cliffs that no trader ever experienced. To a trend rule those cliffs look like crashes, to a stop they look like triggers, and to a volatility filter they look like regime changes. The fix is arithmetic and well defined, but you must confirm your source applies it rather than assuming it does. Many free sources do not, and the ones that do are often silent about which actions they cover.

The second is the point-in-time universe. If your test runs over the current constituents of an index, it runs over the set of companies that survived and got promoted, which is a set selected by the very outcome you are trying to predict. Every company that was delisted, demoted or absorbed has been quietly deleted from history. The correct object is the membership as it stood on each historical date, delistings included, and it is genuinely hard to obtain cheaply in India. This is the single most common reason an Indian small-cap or mid-cap backtest is overstated.

The third is volume and its consequences. Price data is abundant; honest liquidity data is not, and it is the liquidity that decides whether the fills your backtest assumed were available. A rule tested at ten times the size the counter could absorb is not a strategy, it is a fantasy with a chart attached. This one is under-discussed relative to the other two, so it gets its own section below.

What a backtest needs from its data, what free Indian retail sources typically provide, and what the gap costs you (assessment as of 18 July 2026; verify against your own source)
RequirementWhat it meansTypical free-source realityDirection of the error
Adjusted pricesSplits, bonuses and rights applied so the series reflects holder wealth, not quoted priceFrequently unadjusted, or adjusted silently and incompletelyPhantom gaps trigger stops and trend rules that never fired in reality
Point-in-time universeIndex or screen membership as it stood on each historical dateToday's list applied backwards; delisted names absent entirelyOverstates returns, because only survivors are tested
Real traded volumeDaily traded quantity and value, per counter, per sessionUsually present, but rarely used to constrain position sizeAssumes fills the book could not have provided
Corporate action calendarEx-dates, ratios and the action type, separately from priceOften missing, so adjustment cannot be verified or redoneYou cannot audit your own price series
Delisted and suspended namesThe full record of counters that stopped trading, with their final pricesAlmost never available at retail price pointsRemoves precisely the worst outcomes from the sample
Session-level integrityHolidays, halts, circuit-limit days and no-trade sessions flaggedPartially present; halts and circuit days often unflaggedModels trades on days when trading was impossible

Read the right-hand column as a whole and the pattern is uncomfortable: with one exception, every weakness pushes the result in the same direction. That is what makes data quality a first-order concern rather than housekeeping. Random errors would widen your uncertainty and leave the centre roughly right. These errors are systematic, they all point the same way, and no amount of additional history corrects them. A larger sample of a biased record is a more confident wrong answer.

The honest fallback when you cannot fix it. Most individual testers cannot buy a point-in-time universe with delisted names, and pretending otherwise helps nobody. The defensible response is not to give up, it is to narrow the claim. Test on large, liquid, continuously listed index constituents where survivorship distortion is smallest, state in writing that your result is conditional on that universe, and refuse to generalise it to small caps, where the effect is largest and your data is weakest. A narrow claim you can support beats a broad one you cannot.

Could the rule actually be traded at your size?

A backtest fills every order instantly, completely, and at a price the market printed. Real books do none of those things. The gap between the two is not a rounding error to be sprinkled in at the end; on a rule that trades often or trades thin counters, it is frequently the entire result. And the constraint is not the average day. It is the thin day, which is when your rule will often want to act.

The measurement to run is participation: your intended order value as a fraction of the counter's traded value that session. It is a crude proxy for market impact but a useful one, and it has the great advantage that you can compute it from data you already have. Broadly, an order that is a small fraction of one percent of the day disappears into normal flow. An order approaching or exceeding one percent of the day is a meaningful part of what traded, which means your own order is part of the price the backtest assumed you got. Past that, the simulation is describing a market that includes you as a participant while pretending you were not there.

Order size against the volume that was actually there Daily traded value varies by a factor of eight across the sample. The participation rate an order needs is computed against the median day and against the tenth-percentile thin day, showing that the binding constraint is the thin day, not the average one. Your order against the volume that was actually there Illustrative mid-liquidity NSE cash counter, 56 sessions. Daily traded value, ₹ crore. median day ₹36 cr thin day, 10th percentile ₹16.5 cr sessions in a thin stretch 0 20 40 60 80 session 1 session 56 ₹ crore traded Share of the day you must be order median thin day ₹5 lakh 0.14% 0.30% ₹25 lakh 0.69% 1.52% ₹1 crore 2.77% 6.06% Above roughly 1% of the day, your own order moves the price the test assumed. The median day is not the constraint. The thin day is. A ₹1 crore order is 2.77% of a median session here but 6.06% of a tenth-percentile one, and the thin sessions cluster, so the rule meets them in runs rather than one at a time. Test the fills you would get then.
Liquidity is not a constant, and the thin days cluster. Daily traded value on this illustrative counter varies roughly eightfold across fifty-six sessions. A ₹5 lakh order is 0.14% of a median day and untroubled even on a thin one. A ₹1 crore order is 2.77% of a median day and 6.06% of a tenth-percentile day, which is no longer a fill assumption but a wish. Crucially the thin sessions arrive in runs rather than singly, so a rule that trades through one of those stretches meets the worst conditions repeatedly and consecutively, exactly when a naive average-based cost estimate says it should be fine. Illustrative figures.

This produces a rule of thumb worth carrying: a strategy has a capacity, and capacity is part of the strategy. The same rule can be entirely real at five lakh and entirely fictional at one crore, and nothing in a standard backtest output will tell you which side of that line you are on, because the standard output does not know your size. You have to ask the question separately, and you have to ask it against the thin sessions rather than the median one.

There is a second consequence that catches people later. Because capacity binds, a strategy that works cannot simply be scaled up with the account. As the account grows, participation grows, impact grows, and the net edge shrinks. A rule validated at one size needs re-validating at the next, which is an unwelcome discovery to make after the capital has arrived rather than before.

The procedure: the order of operations is the method

Here is the part that most guides get subtly wrong. They present backtesting as a list of steps, which implies the steps are interchangeable chores. They are not. The steps have a required order, and the ordering carries almost all of the method's protective power. Do the same six things in the wrong sequence and you have done nothing at all, even though every individual step was performed correctly.

The order is: specify the rule, seal the held-out block, build the cost model, run in-sample, decide against the thresholds you declared, and only then open the seal. Every one of those precedes measurement of the thing it protects. Specification precedes testing so that hindsight cannot leak into the rule. Sealing precedes running so that the held-out block is genuinely unseen. The cost model precedes the result so that you are not tempted to choose the cost assumption that makes the answer come out well, which is a real and very human failure. Declaring thresholds precedes seeing the number so that the number cannot set the threshold.

The sealing step deserves particular attention because it is where the most common and most invisible error lives. A held-out set is not defined by its position on the calendar. It is defined by what you did not know when you chose it.

Sealing the held-out block before measuring, versus splitting after looking The same history and the same rule produce different evidential value depending only on when the split was made. A block sealed before any measurement tests the rule; a block carved out after the whole history was examined does not. When you split decides what the split is worth Same history, same rule, same software. Only the order of operations differs. Sealed first split drawn before any measurement develop and tune here (in-sample) sealed until the end every decision made here opened once, after the rule was frozen this block is evidence Split after whole history examined, then carved up the whole history was looked at, tuned on, and looked at again split drawn here, afterwards this block is not evidence, it is memory A held-out set is defined by what you did not know when you chose it, not by where it sits on the calendar.
Two identical-looking splits, one of which is worthless. In both timelines the final stretch of history is labelled the held-out block, and a report generated from either would look the same. But in the lower one the whole record was examined, tuned against and examined again before the line was drawn, so the block was already known when it was selected. It cannot surprise you, and a test that cannot surprise you is not a test. The distinction is invisible in the output and invisible in the code. It exists only in the sequence of what you did.

Two practical notes on sealing. First, seal by writing the split date into your configuration before you load anything, not by remembering to ignore the tail. Memory is not a control. Second, if you have already explored the full history informally, which is often true because the idea came from looking at charts, then be honest that you have no clean held-out block in that data at all. The remedy in that case is time: the genuinely unseen data is the data that has not happened yet, which is what forward testing is for, and it is one of several reasons the process does not end at the backtest.

The rolling generalisation of a single split, where you repeatedly fit on one window and test on the next unseen one across the whole timeline, is a stronger version of the same discipline and is covered as a defence in the companion piece. The ordering principle here is identical and prior to it: whatever scheme you use, each test block must be sealed before the model that will be tested on it is chosen.

Costing the round trip: the arithmetic, with verified rates

Costs are the step where a backtest is most often quietly wrong, not because people forget them but because they estimate them with a single round number. India's statutory stack is knowable to several decimal places, and its structure has a feature that catches people: the largest line by far is Securities Transaction Tax on delivery, which is levied on both legs, while the intraday equivalent is levied on the sell alone. That single asymmetry makes the statutory cost of a delivery round trip roughly six times that of an intraday one.

The rates below are the framework as of 18 July 2026. Statutory rates change with each Finance Act and exchange charges change by circular, so verify at source before you rely on them for anything that matters.

The Indian cash-segment cost stack, per round trip, as a percentage of turnover (rates as of 18 July 2026; verify against the current exchange circular and the Finance Act in force)
LineBasisDelivery round tripIntraday round tripGST applies?
Securities Transaction TaxTurnover; delivery both legs, intraday sell only0.2000%0.0250%No
Exchange transaction chargeTurnover, each side (NSE cash)0.0061%0.0061%Yes
SEBI turnover feeTurnover, each side0.0002%0.0002%Yes
Stamp dutyTurnover, buy side only0.0150%0.0030%No
Statutory subtotalThe part you cannot negotiate0.2225%0.0355%
BrokerageNegotiated, per side; often a flat capVariesVariesYes
GST18% on brokerage and charges, not on turnoverVariesVaries
Depository chargeFlat, per scrip, on the delivery sellFlat feeNoneYes
Slippage and impactTurnover, each side; the estimated lineYour assumptionYour assumptionNo

Three structural points follow from that table, and each changes how you build the cost model rather than merely how large it is.

The statutory floor is asymmetric by holding period. At 0.2225% versus 0.0355%, a delivery round trip starts more than six times deeper in the hole than an intraday one. A rule that holds for days needs a materially larger gross edge to clear its costs than one that closes the same session, and that is a design constraint you should know before you build the rule, not after.

GST does not apply to the two biggest statutory lines. It applies at 18% to brokerage, exchange charges, the SEBI fee and depository charges, but not to STT or stamp duty. Modelling GST on the whole stack overstates costs, while modelling it on brokerage alone understates them. Both errors are common, and both are avoidable by keeping the lines separate in your cost function instead of collapsing them into one percentage.

Only one line is an assumption. Every statutory charge is a published number you can look up. Slippage is the sole line you have to estimate, and as the next section shows, it is also the line that usually decides the answer. That is an uncomfortable combination and it deserves to be treated as the central modelling problem rather than a footnote.

Do not model costs as one blended percentage. A single number like "assume 0.3% round trip" hides the structure that matters: which lines scale with turnover, which are flat, which apply to one leg only, which attract GST, and which are estimates rather than facts. Flat charges bite small orders hardest and vanish on large ones. Buy-side-only charges make the two legs asymmetric. A blended figure gets the total roughly right for one order size and is wrong for every other, and it makes the sensitivity analysis in the next section impossible to run, because you cannot vary the one line that is uncertain if you have already merged it with the six that are not.

Net edge is a residual, so the cost assumption is the result

Now the arithmetic, and it is worth doing slowly because the shape of the answer is more instructive than its size. Take a plausible intraday rule with a gross edge of 0.25% per round trip on a liquid counter, running about 250 round trips a year. Subtract the verified stack line by line and see what survives.

Net edge is a small residual of two much larger numbers A ledger subtracts the statutory Indian cost stack and slippage from an assumed gross edge, leaving a thin net. A sensitivity curve then shows that varying only the slippage assumption moves the annual result from strongly positive to negative, crossing zero at nine and a half basis points per side. The cost assumption is the result Illustrative intraday rule, NSE cash, 250 round trips a year. Rates as of 18 July 2026. One round trip, per rupee of turnover Gross edge (assumed) +0.2500 0.2500 STT, intraday sell 0.025% −0.0250 0.2250 Stamp duty, buy side 0.003% −0.0030 0.2220 Exchange txn 0.00307% each side −0.0061 0.2159 SEBI turnover fee 0.0001% x2 −0.0002 0.2157 Brokerage 0.01% each side −0.0200 0.1957 GST 18% on brokerage + charges −0.0047 0.1909 Slippage 0.05% each side −0.1000 0.0909 Net per round trip +0.0909% 36% of the gross survived. The other 64% was cost. Annual result vs the slippage you assume +40% +20% +0% -20% break-even 9.5 bp/side +22.7% −12.3% 2 5 8 11 15 slippage assumed, basis points per side annual return Five basis points of disagreement about slippage decides the sign of the whole backtest. Both 5 bp and 12 bp per side are defensible assumptions for this counter. One reports +22.7% a year, the other −12.3%. Nothing about the rule changed.
The net is what is left over, and it is thinner than either number that made it. A gross edge of 0.25% and a total cost of 0.159% leave 0.091%, so roughly 36% of the gross survived and 64% was consumed. That is the ordinary condition of a real strategy, not a pathological case. The right panel is the consequence: hold the rule, the data and every statutory rate constant, vary only the slippage you assume, and the annual result travels from strongly positive to negative, crossing zero at 9.5 basis points per side. Both 5 bp and 12 bp are defensible assumptions for the same counter. Illustrative model outputs, not a projection of returns.

Sit with the right-hand panel, because it is the most important thing on this page. The rule did not change. The history did not change. The statutory rates did not change. The only thing that moved was a single estimated input, across a range that any two careful people could disagree about, and the sign of the entire conclusion moved with it. This is what it means to say the cost assumption is the result rather than an adjustment to it.

Three consequences follow, and they are the practical content of this section.

First, state the slippage assumption as a number, in writing, before the run, in basis points per side, with a reason attached. "Five basis points because our typical order is under 0.2% of median traded value on this counter" is a defensible assumption. An unstated one is not an assumption at all, it is a preference that will drift toward whatever makes the result look good.

Second, report the break-even, not just the answer. The most honest single number this analysis produces is not the net edge, it is the slippage at which the net edge becomes zero, here 9.5 basis points per side. That figure tells a reader exactly how much room the strategy has, and it is robust in a way the headline is not. A rule whose break-even is 40 basis points is genuinely different from one whose break-even is 9.5, even if both report the same net today.

Third, if the honest range of cost assumptions spans zero, the correct conclusion is that you do not know. That is a real finding and it should be reported as one. It is not a failure of the test; it is the test working. The failure would be picking the assumption that lands on the answer you wanted and describing the result as validated. If you want to see how the statutory lines move with order size and segment before fixing your own figures, the cost estimator computes the published components from your inputs.

What to measure once the run finishes

The equity curve is the output everyone looks at and the output that carries the least decision-relevant information per square inch. It is a single path. It shows one ordering of one set of trades, and reordering the same trades produces a visually different curve with identical underlying statistics. What you actually need is the per-trade distribution and the sample size behind it.

Start with expectancy per trade, the average outcome of one application of the rule, net of costs. It is the number that scales: multiply it by the number of trades you expect and you have the strategy's contribution, which is exactly what a curve does not let you do. Expectancy also survives translation between account sizes and between instruments, which the curve does not. Measuring it properly, in R-multiples so that trades of different sizes are comparable, is its own subject and is covered in measuring a trading edge. For the purposes of a backtest report, the requirement is simply that expectancy is present, that it is net of the full cost model, and that it is reported beside the count of trades it came from.

Then trade count, which governs how much any other number can be trusted. It is not glamorous and it is not optional. A superb expectancy over eighteen trades is an anecdote. The same expectancy over four hundred trades spanning several market conditions is evidence. Report the count adjacent to every metric, not in a footnote, because a reader who sees the metric without the count will over-trust it and so will you.

Then drawdown in both dimensions. Depth is how far equity fell from its peak. Duration is how long it stayed below that peak before making a new high, and duration is the one that ends strategies, because it is the dimension a human has to sit through. A twenty percent drawdown lasting five weeks and a twenty percent drawdown lasting two years are the same number and completely different experiences. Report both or you have reported neither.

The backtest report card: what to report, why it is on the list, and the specific claim it does not support
ReportWhy it is on the listWhat it does not tell you
Expectancy per trade, netThe only figure that scales with the number of trades you expect to takeNothing about the spread of outcomes around it, or the order they arrived in
Trade countGoverns how much every other number on this card can be trustedWhether the trades were independent, which clustered signals quietly break
Drawdown depthThe capital consequence of the worst historical stretchHow long it lasted, which is usually the binding constraint on a human
Drawdown durationThe time underwater, which is what actually ends strategiesWhether a longer one is available in histories you did not sample
Break-even cost assumptionShows how much room the edge has before the sign flipsWhether your central slippage estimate was reasonable to begin with
ExposureTime actually in the market, so a selective rule is judged fairlyWhether the out-of-market periods were skill or luck
Result by regimeWhether the edge appears in rising, falling and flat conditions alikeWhether the next regime resembles any of the ones you sampled
Worst single tradeThe tail you must be able to survive, not the average you hope forWhether a worse one exists outside the tested window, which it usually does

Now the honest part, which belongs on the report card rather than in a disclaimer at the bottom. A good backtest cannot show that a strategy works. It can only fail to disqualify it. This is not modesty, it is the logical structure of the thing: the test asks whether the rule would have failed on data it had not seen, and a negative answer is a failure to reject, not a confirmation. Every strategy that eventually blew up passed its backtest first. Passing is the entry requirement, not the verdict.

What follows from that is a change in what you claim rather than a change in what you do. The defensible sentence after a clean run is: "this rule was not disqualified, on a point-in-time universe, under a stated cost model, on data it had never seen, over N trades." That sentence is a great deal weaker than "this strategy works," and it is the strongest one the evidence supports.

When to stop: retesting until it passes is the overfitting

Suppose you ran the procedure properly. You specified, sealed, costed, ran in-sample, declared thresholds, opened the held-out block, and the rule failed. What now?

The honest answer is the unpopular one: that rule is done, at least on that data. The tempting answer, and near-universal practice, is to adjust something and run the held-out block again. This feels like diligence. It is the single most effective way to manufacture a false positive, and it is worth being precise about why, because "you overfitted" is usually asserted rather than explained.

The held-out block protects you for exactly one reason: the rule was chosen without reference to it. The moment you observe the held-out result and change the rule in response, the next test is no longer independent, because the block participated in selecting what gets tested. Run it enough times and you are simply searching the held-out data for a variant that happens to pass, which is precisely the activity the block existed to prevent. The protection is not weakened by repetition. It is spent.

The one-look budget: what each extra look at the held-out set costs A pre-registration card fixes every decision before the held-out block is opened. The adjacent curve shows that if each retuned variant has a one-in-twenty chance of clearing the bar by luck, reusing the held-out set ten times raises the chance of a false pass to about forty percent. Retesting until it passes is the overfitting The held-out block is a single-use instrument. Spending it is a decision, not a formality. Written down before the seal is broken The rule every parameter fixed, no free choices left The cost model slippage in bp per side, stated and defended Minimum trade count below it, the test does not report Pass thresholds expectancy, drawdown, exposure, declared now The test run once, on data never opened before The answer accepted either way, including no Chance a pure-noise rule clears the bar 0% 20% 40% 60% looks false-pass odds 1 5% 5 23% 10 40% 20 64% 1 5 10 15 20 times the held-out set is reused after a retune false-pass odds One look costs you 5%. Ten looks cost you 40%. Assumes each retuned variant has a 1-in-20 chance of clearing the bar on noise alone, and that the retunes are independent. Both are optimistic.
The held-out block is a single-use instrument. If a retuned variant with no real edge has a one-in-twenty chance of clearing the bar on noise alone, then one look carries a 5% risk of a false pass, five looks 23%, ten looks 40%, and twenty looks 64%. At that point you are more likely than not to be looking at a rule that passed for no reason. Both assumptions behind the curve are generous: real retunes are correlated rather than independent, and a tester who keeps going until something passes is not sampling at random. Illustrative model.

So the stopping rule has to be part of the protocol, declared with everything else, and it comes in three legitimate forms. Accept the failure and abandon the rule, which is the cheapest and most under-used option. Redesign from the hypothesis, treating the failed rule as informative, and then test on data that this new rule has genuinely never touched, which usually means waiting for it or reserving a second block from the start. Or collect new data forward, which is slow, and which is the only one of the three that manufactures genuinely unseen observations rather than reusing old ones.

What is not on the list is adjusting a parameter and re-running the same block. If you find yourself reaching for it, the useful thing to notice is that you have stopped testing the rule and started negotiating with the data. The tell is easy to spot in retrospect and almost invisible in the moment: you are now searching for the version that passes, rather than asking whether this version does.

A practical discipline that makes this survivable. Reserve two held-out blocks at the start, not one, and write down that the second may be opened exactly once, only after a full redesign from the hypothesis, and never after a parameter adjustment. This gives you one legitimate second chance without pretending you have unlimited chances, and because the budget was fixed in advance it cannot expand under pressure. When the second block is spent, the honest position is that you have no further evidence available from this history, and you must either wait for new data or stop.

What a passed backtest actually entitles you to

A rule that survived this procedure has earned something specific and limited: promotion to the next stage of testing. It has not earned capital at size, and it has not earned confidence proportional to how good the curve looked.

The next stage is forward testing on live data without money at risk, which is the only source of genuinely unseen observations available to you and the only stage that exercises the parts a historical simulation cannot reach: whether your signals actually fire when you expect, whether the data arrives in time to act, whether the orders you intended are the orders you place. Its mechanics, and the specific ways a simulator flatters you, are covered in the paper-trading guide. After that comes a slow live ramp at a fraction of intended size, where the question is narrow and empirical: are the fills you are getting consistent with the slippage assumption your whole result depended on? If they are not, you learned it at small size, which is the entire point of ramping.

And then the expectation, which should be set now rather than discovered later: live results typically trail the backtest. The causes are structural rather than personal. Fills are worse than assumed. Costs apply to every trade rather than to the average one. The regime drifts away from the one the rule was fitted to. If the edge is easy to find, others find it. A process that treats the backtest curve as a forecast will read this ordinary decay as failure and abandon a working rule at the wrong moment; a process that expected it sizes for the gap in advance.

The claim to hold on to. The strongest honest statement available after all of this is negative, and it is worth memorising in that form: this rule has not been disqualified yet. Not that it works. Not that it will continue. Only that it survived a procedure designed to kill it, under stated costs, on data it had not seen, over a sample large enough to matter. That is genuinely valuable, and it is the most any historical test can give you. The context is sobering and worth keeping in view: SEBI's study of individual traders in the equity derivatives segment (September 2024) found that about 93% of individual traders in equity derivatives made net losses over FY22 to FY24. Rigour in testing is not a guarantee against that. It is simply the difference between a decision made on evidence and one made on a picture.

None of this requires institutional infrastructure. It requires ordering the steps correctly, writing down the thresholds before you look, costing the round trip from published rates rather than a round number, and spending the held-out block once. That sequence, and the habit of preferring the narrow claim you can support to the broad one you cannot, is the substance of the method we teach.

FAQ

Frequently asked questions

Backtesting is running a fully specified set of rules over historical data to see how they would have behaved. The useful way to think about it is as an experiment rather than a measurement: it needs a hypothesis, a protocol fixed in advance, controls such as adjusted prices and a point-in-time universe, and a decision rule that can return a negative answer. A process that cannot conclude no is not testing anything. Its output is a distribution of per-trade outcomes and a sample size, not a single future return.

In this order, and the order carries most of the protection. Specify the rule so precisely that a machine could follow it identically every time. Seal a held-out block of history before you measure anything. Build the cost model from published statutory rates plus a stated slippage assumption. Run on the in-sample portion only. Decide against thresholds you wrote down before seeing any result. Then open the held-out block once. Performing the same six steps in a different sequence removes almost all of their value, even if each step is done correctly.

Four things, and Indian retail sources are weak on three of them. You need prices adjusted for splits, bonuses and rights, because unadjusted series contain mechanical cliffs no trader experienced. You need a point-in-time universe, meaning index or screen membership as it stood on each historical date, with delisted names included. You need real traded volume, so you can check whether the fills you assumed were available. And you need a corporate action calendar so the adjustment can be audited. Volume is usually present; the other three frequently are not.

There is no fixed threshold, but confidence scales with the number of independent trades rather than the number of calendar years. A result from eighteen trades is an anecdote no matter how clean it looks. You want enough trades to span rising, falling and flat conditions, because a rule that only ever met one regime has been flattered rather than tested. Report the trade count immediately beside every other metric, because a reader who sees a metric without its sample size will over-trust it, and so will you.

The full statutory stack plus friction, kept as separate lines rather than one blended percentage. As of 18 July 2026 the cash-segment framework is Securities Transaction Tax at 0.1% on each side for delivery but 0.025% on the intraday sell only, the NSE cash exchange transaction charge of about 0.00307% per side, the SEBI turnover fee of 0.0001% per side, stamp duty on the buy side only at 0.015% for delivery and 0.003% for intraday, 18% GST on brokerage and charges but not on STT or stamp duty, plus depository charges on delivery sells. Then add your slippage estimate. Verify current rates at source, because they change with statute and circular.

Assume a number you can defend, state it in basis points per side before the run, and then test how sensitive your conclusion is to it. Slippage is the only line in the cost stack that is an estimate rather than a published rate, and it is usually the line that decides the answer. A useful anchor is your order size as a share of the counter's traded value on a thin session rather than an average one. If the honest range of assumptions moves your result from positive to negative, the correct conclusion is that you do not know yet, and that is a genuine finding rather than a failure.

A held-out set is a block of history sealed before you measure anything, used exactly once at the end to test a rule that was frozen without reference to it. It is defined by what you did not know when you chose it, not by where it sits on the calendar, which is why carving one out after examining the whole history gives you no protection at all. It is a single-use instrument. Each additional look after a retune raises the chance that whatever survives did so by luck, so the number of looks belongs in the protocol, declared in advance.

No, and this is a structural limit rather than a matter of degree. A backtest can only fail to disqualify a rule. The question it asks is whether the rule would have failed on data it had not seen, and a negative answer is a failure to reject rather than a confirmation. Every strategy that eventually blew up passed its backtest first. The strongest defensible sentence after a clean run is that this rule was not disqualified, on a stated universe, under a stated cost model, on unseen data, over a stated number of trades.

Not on the same block, and this is the most common way a false positive is manufactured. The held-out block protected you only because the rule was chosen without reference to it; once you see the result and change the rule in response, the next test is no longer independent and the protection is spent rather than merely weakened. The three legitimate responses are to accept the failure and abandon the rule, to redesign from the hypothesis and test on data the new rule has genuinely never touched, or to collect new data forward. Reserving a second block at the outset, openable exactly once and only after a full redesign, gives you a real second chance without pretending you have unlimited ones.

Where the facts come from

Sources

  • Securities Transaction Tax. Finance (No. 2) Act 2004, Chapter VII, section 98, Table serials 1 and 2, with the rate set by the Finance Act 2012 with effect from 1 July 2012: 0.1% on the delivery purchase and 0.1% on the delivery sale of an equity share, and 0.025% on the intraday sell. Establishes the asymmetry that makes a delivery round trip roughly six times more expensive in statutory terms than an intraday one.
  • Exchange transaction charges, NSE cash segment. NSE circular NSE/FA/73061 (27 February 2026), effective 1 March 2026, setting the cash market transaction charge at ₹307 per crore per side, that is 0.00307% all in, inclusive of the revised NSE investor protection fund trust contribution. Establishes the exchange line in the cost stack. www.nseindia.com
  • SEBI turnover fee. SEBI (Stock Brokers) Regulations: turnover fee of 0.0001% of turnover, that is ₹10 per crore, in the cash segment, payable on both purchase and sale. Commonly confused with the separate NSE investor protection fund trust contribution, which is a different levy with a different recipient. www.sebi.gov.in
  • Stamp duty on securities. Indian Stamp Act 1899, Schedule I, Article 56A(b), as amended with effect from 1 July 2020: a uniform national rate of 0.015% on delivery transfer and 0.003% on intraday, charged to the buyer only and collected by the clearing corporation. Establishes why the two legs of a round trip are not symmetric.
  • GST on brokerage and charges. Notification 11/2017-Central Tax (Rate), 28 June 2017, Serial 15, Heading 9971, with SAC 997152 for brokerage and related securities services, at 18%. GST applies to brokerage, exchange transaction charges, the SEBI turnover fee and depository charges, but not to STT or stamp duty, which the broker remits as a pure agent under Rule 33 of the CGST Rules 2017.
  • Individual trader outcomes in equity derivatives. Securities and Exchange Board of India, Study on the Profit and Loss of Individual Traders Dealing in the Equity Futures and Options Segment (September 2024), covering FY22 to FY24. The figure it reports is quoted once in the body of this guide, as context for why testing discipline matters rather than as a claim about any strategy. www.sebi.gov.in
Educational note. This guide explains how to design, cost and validate a backtest. It is not a recommendation to trade or invest, and it is not investment advice. Every rupee amount, percentage and annual figure on this page is illustrative and produced by the arithmetic shown, not a projection of returns; backtested and hypothetical results have inherent limitations and do not represent actual trading. Statutory rates and exchange charges are stated as of 18 July 2026 and change with statute and circular, so verify them at source before relying on them. Bharath Shiksha is an educational publisher, not a SEBI-registered investment adviser or research analyst.

Related guides

Building a trading system in India

Read →

A backtest is an experiment. Learn to design one that can say no.

Educational reference only. No buy, sell or hold recommendations. Backtested results are hypothetical and have inherent limitations.