Trading · 7 min read
Backtesting Trading Strategies: How To Do It Honestly
Backtesting is the only way to know if a strategy has an edge — and the easiest place to lie to yourself. A practical guide to honest backtests, walk-forward validation, and the biases to design around.
By Jarviix Editorial · Apr 19, 2026
A backtest is a controlled experiment: "If I had run this strategy mechanically over the last N years, what would my equity curve look like?" Done well, it's the cheapest possible way to discover whether a strategy has an edge before risking real money. Done badly — which is most of how it's done — it's an elaborate way to convince yourself that a curve-fit fantasy is a tradable system.
The line between honest backtesting and self-deception is thinner than most people realise. It's also entirely about discipline: a small set of methodological habits separates the backtests that translate to live trading from the ones that turn into "I don't understand, it worked perfectly in the simulator" once real money is on the line.
This guide walks through how to backtest a strategy honestly, the biases to design around, and how to interpret the results without lying to yourself.
What a backtest is actually testing
A backtest answers one specific question: "Across the historical period I ran this on, with these specific rules and assumptions, what would the trade-by-trade results have been?"
It does not answer:
- Whether the strategy will work in the future.
- Whether the assumptions will hold in different regimes.
- Whether the edge is causal or coincidental.
- Whether you'll execute it correctly under emotional pressure.
A backtest is necessary but nowhere near sufficient. The point isn't to "find the strategy that works best in backtest" — it's to falsify obviously broken ideas cheaply and to estimate realistic expectancy on ideas that survive scrutiny.
The honest backtest checklist
Before trusting any backtest result, work through this list. If any item fails, the result is suspect.
1. The rules are mechanical and complete. "Buy at support" isn't a backtest rule — it's a vague intent. "Buy at the daily close if (a) price is above the 200 SMA, (b) RSI(14) crosses above 30, (c) the previous candle made a higher low than the candle 3 bars before" is a rule. If you can't write the strategy as code or as an unambiguous flowchart, you can't honestly backtest it.
2. There are no peeked-future inputs. A surprisingly common bug: using data the strategy wouldn't have had at decision time. Examples: using the day's high to decide whether to enter at the open, using a 50-period MA that includes today's close as a filter at the start of today's trading. The technical name is "look-ahead bias," and it produces beautiful equity curves that are entirely fictional.
3. Slippage and costs are modelled. Use realistic round-trip costs (0.05–0.15% on liquid instruments, more for small-caps). Assume you don't get the absolute best fill — fill at the next available price, not the level. Skipping this in backtests is the difference between "this is profitable" and "this barely covers the broker's fees."
4. The sample is large enough. Aim for 300+ trades across the strategy's lifetime. A strategy with 40 trades that shows a 65% win rate is statistically a 50% win rate with luck. Small samples lie.
5. The data covers multiple regimes. At minimum: one bull market, one bear market, one extended sideways period. A strategy backtested only in a strong trend is only documented to work in strong trends. Markets change regimes; your backtest needs to demonstrate the strategy doesn't.
6. There's an out-of-sample period. Reserve at least 30% of your data for out-of-sample validation. Build the strategy on the first 70%; run it untouched on the last 30%. If performance degrades dramatically out-of-sample, you've curve-fit and the in-sample results aren't real.
7. The number of parameters is small. Each tunable parameter is a degree of freedom — a place to overfit. A strategy with one parameter (the moving average length) has limited overfitting capacity. A strategy with 8 parameters (fast MA, slow MA, RSI threshold, RSI period, stop %, trailing stop activation, time-of-day filter, day-of-week filter) can be tuned to fit any historical noise. As a rough rule, demand at least 30 trades per parameter — fewer than that, and the optimisation is fitting noise.
Biases to design around
Selection bias / survivorship bias. A backtest run on the current Nifty 50 constituents is testing on the survivors. The companies that got booted off the index over the years aren't in the data. This silently inflates returns for any strategy. The fix is to use point-in-time index constituents, or run on a broader (less curated) universe.
Curve-fitting. Tuning parameters until the backtest looks beautiful, on the assumption that the future will resemble the past in detail. Almost guarantees the strategy will fail live. The defence is small parameter counts, fixed parameters across instruments, and out-of-sample validation.
Hindsight in rule design. "I noticed in 2020 that the COVID crash gapped down on a Monday, so my rule includes a Monday gap filter." This isn't a discovered edge — it's a rule designed to fit a known historical event. Will the next crash also gap down on a Monday? Probably not. The general form of this trap: any rule that's added because you noticed it in the data is suspect.
Optimistic execution assumptions. Assuming you'd have executed every signal cleanly, with no missed trades, no slippage, no whippy fills, no internet outages, no human hesitation. Reality is messier. Build a "missed trades" assumption into the backtest (e.g., 5% of signals don't get taken cleanly), and watch how much equity curves deteriorate.
Walk-forward validation
The most rigorous methodology: walk-forward analysis. Roughly:
- Split data into windows (say, 2 years of data per window).
- Optimise the strategy on the first window.
- Trade the optimised strategy unchanged on the next window (out-of-sample for that test).
- Re-optimise on a sliding window. Repeat.
The "live" performance is the concatenation of all out-of-sample periods. This is the closest backtest analog to how you'd actually run a strategy live — periodically reviewing parameters, but trading the most recent fit on never-before-seen data.
If walk-forward results are dramatically worse than full-sample optimised results (very common), the gap tells you how much of the backtest's beauty was overfit.
What to actually look at in the results
Once the backtest is done, ignore the headline return. Look at:
- Expectancy per trade. Average rupees won per trade after costs. If it's tiny, the strategy doesn't have meaningful edge.
- Maximum drawdown. The worst peak-to-trough loss. If max drawdown is 35%, you'll need to be willing to actually trade through a 35% drawdown — most retail traders aren't.
- Time underwater. How long the strategy spent below previous equity highs. Many "profitable" strategies spend 70% of their lives in drawdown. Emotionally brutal to live with.
- Win rate vs RR shape. A 35% win rate with 1:3 RR feels different to live than a 65% win rate with 1:1 RR, even if both have the same expectancy. Make sure the shape of the strategy fits your psychology, not just the bottom line.
- Performance by regime. Group results by year, by volatility regime, by trend direction. A strategy that only works in trending markets is a strategy with a known failure mode — fine if you know it.
The risk simulator is useful for taking the backtest's win rate and RR and stress-testing how the equity curve might evolve under variance. Often the backtest looks pristine and the simulator shows that 1-in-20 outcomes are a 25% drawdown.
What to read next
- Position sizing explained — the variable a backtest can't tell you about your psychology.
- Risk-reward ratio in trading — the headline number every backtest should report alongside win rate.
- How to build a trading plan — where backtest results become live rules.
- Why most traders lose money — including the "I have a strategy that backtests beautifully" trap.
A backtest is a flashlight, not a crystal ball. It can show you that an idea is obviously broken (very useful — saves you real money). It can give you a rough estimate of expectancy on an idea that survives (somewhat useful — sets calibrated expectations). It cannot guarantee future performance. Treat it accordingly: validate ruthlessly, size conservatively, and let live trading — small at first — be the final test that matters.
Frequently asked questions
How many trades do I need in a backtest to trust the results?
At minimum 100 trades, ideally 300+, across multiple market regimes. A backtest with 30 trades that shows a 60% win rate is statistically indistinguishable from a 50% win rate due to small-sample noise. Beyond raw count, what matters is regime coverage — make sure the data spans at least one bull, one bear, and one sideways market. A strategy backtested only in 2017 (a low-volatility uptrend) tells you almost nothing about how it'll behave in 2020 or 2022.
What's the difference between in-sample and out-of-sample testing?
In-sample is the data you use to design and tune the strategy. Out-of-sample is data the strategy has never seen, used to validate that performance generalises. The standard split is 70/30 — design on the first 70% of history, validate on the last 30%. If the strategy works in-sample but fails out-of-sample, you've curve-fitted to the past, not discovered an edge. This is the single most important honesty check in backtesting.
Are TradingView backtests reliable?
For simple strategies on a single instrument, broadly yes. For anything involving slippage modelling, realistic position sizing, walk-forward validation, or multi-instrument portfolios, TradingView's defaults are too generous and the platform isn't designed for rigorous validation. Use it to prototype an idea quickly; if the idea looks promising, port to a more serious backtester (Backtrader, Zipline, or Python with pandas) before risking capital.
How much should I worry about transaction costs and slippage in backtests?
Substantially. A strategy that looks profitable before costs but breaks even after costs is not an edge — it's a tax on you. Realistic Indian retail costs include brokerage (₹20 flat or 0.03%), STT, exchange charges, GST, and slippage (typically 0.05–0.15% on liquid instruments, more on small-caps). For intraday strategies, the all-in cost can easily reach 0.1–0.2% per round trip. Build this into the backtest from day one, not as an afterthought.
Read next
Apr 19, 2026 · 7 min read
How To Build A Trading Plan: A Working Template You'll Actually Follow
Most 'trading plans' are vibes. A practical, written template covering markets, setups, sizing, risk, journaling, and review — the document that makes profitable trading repeatable.
Apr 19, 2026 · 5 min read
Risk-Reward Ratio In Trading: What 1:2 And 1:3 Actually Mean
Win rate is overrated. Risk-reward is what makes a trading system survive. A clear, math-first guide to expectancy, payoff ratios, and why most setups quietly need a 1:2 to be profitable.
Apr 19, 2026 · 5 min read
Algorithmic Trading for Beginners: A Realistic Introduction
Algo trading isn't about getting rich automatically. What algorithms can and can't do, what infrastructure you need, and how to start without losing your shirt.