PROGRAM ZERO 18-month live AI, LLM & full-stack programme · ₹5,999 for all 18 months · Starts 9 January 2027
Explore Program Zero →
Careers Ninza — business and startup leadership training
JOIN ZERO NINZA KIDS
JOIN ZERO NINZA KIDS
See all programs → Free live masterclass → Guides & articles → Newsletter →
Careers Ninza
DATA SCIENCE 8 min read · Updated 3 October 2026

Backtesting a trading strategy: nine mistakes that make good results lie

A beautiful backtest is easy to build and easy to fool yourself with. The nine most common mistakes, from look-ahead bias to ignoring costs, and how to test a strategy honestly.

CN
Careers Ninza faculty
Careers Ninza · Kolkata, India

A backtest tests a trading strategy on historical data to see how it would have performed. It is essential, and it is also the easiest place to fool yourself. Most strategies that look brilliant in a backtest fail live because of a few repeatable mistakes: look-ahead bias, overfitting, survivorship bias and ignoring costs and slippage.

Nothing in this article is investment advice, and no backtest guarantees future returns. The goal is narrower: to help you tell the difference between a strategy that might work and one that only works on the past.

What is a backtest actually measuring?

A backtest replays history and applies your rules as if you had traded them. It measures how the rules would have behaved on that specific data, under the assumptions you made about prices, costs and execution. Every unrealistic assumption makes the result look better than reality. The skill is in removing those assumptions one by one.

Which mistakes make backtests lie?

1. Look-ahead bias

Using information that was not available at the time of the trade, such as using a day’s closing price to decide a trade placed at that day’s open. It is the most common bug and produces impossibly good results.

2. Overfitting

Tuning parameters until the strategy fits past data perfectly. A strategy with many tuned settings often captures noise, not a real pattern, and collapses on new data.

3. Survivorship bias

Testing only on stocks that exist today ignores the companies that were delisted or collapsed. Results look better because the losers are missing from the data.

4. Ignoring costs and slippage

Brokerage, taxes, exchange charges and the gap between the price you see and the price you get add up fast, especially for frequent trading. Many profitable-looking intraday strategies become loss-making once realistic costs are included.

5. Unrealistic fills

Assuming every order fills at the exact price, in any size. Illiquid stocks and fast markets do not work that way.

6. Too little data, or one market regime

A strategy tested only in a rising market has not been tested. Include different conditions: trending, sideways and sharply falling periods.

7. Data snooping

Trying hundreds of ideas on the same data and keeping the best one. By chance alone, something will look good.

8. Ignoring drawdowns

Judging only total return hides the pain. A strategy that falls 40 percent before recovering may be impossible to stick with in real life.

9. No out-of-sample test

If every bit of data was used to design the strategy, you have nothing left to check it on.

How do you backtest honestly?

PracticeWhy it helps
Split data into in-sample and out-of-sampleTests the rules on data they never saw
Walk-forward testingRe-tests as time moves forward, like real trading
Realistic costs and slippageShows whether the edge survives friction
Few, sensible parametersReduces overfitting
Paper trading before real moneyCatches execution and data issues

What metrics should you look at?

—Net return after all costs, not gross return.
—Maximum drawdown and how long recovery took.
—Win rate together with average win and average loss.
—Number of trades: a handful of trades proves very little.
—Consistency across years and market conditions.

What about rules for algo trading in India?

Algorithmic trading by retail investors in India is regulated, and rules for how retail algos must be offered through brokers have been evolving. Check the current position on the SEBI website and with your broker before running any automated strategy with real money.

Treat any backtest that looks too good as a bug until proven otherwise. In practice, it almost always is.

What does an honest backtest workflow look like?

—Write the strategy rules in plain language before touching data.
—Get clean, adjusted historical data, including delisted instruments where possible.
—Reserve the most recent period as out-of-sample and do not look at it while designing.
—Code the rules so each decision uses only information available at that moment.
—Add realistic brokerage, taxes, charges and slippage.
—Run the backtest, then a walk-forward test, then paper trade for several weeks.
—Only then consider small real positions, with strict risk limits.

Which tools do you need?

Python with pandas and NumPy handles data and calculations, a plotting library shows equity curves and drawdowns, and a backtesting library or your own simple event loop runs the rules. Good data matters more than clever code: adjusted prices for splits and dividends, correct timestamps and, ideally, delisted instruments. Keep every experiment in a notebook or log, including the ideas that failed, so you can see how many things you tried before finding a winner. That record is your best defence against data snooping.

How do you judge whether an edge is real?

Ask whether there is a sensible reason the pattern should exist, such as behaviour, structure or risk, rather than only a statistical result. Check that small changes to parameters do not destroy performance; fragile strategies are usually overfitted. Look at results year by year, not just the total. A modest, stable edge that survives costs is far more valuable than a spectacular curve built on a handful of trades.

What skills do you need to do this properly?

Python and pandas for handling data, enough statistics to recognise noise, and a working understanding of market microstructure: how orders, spreads and liquidity work. Our guide on how much maths machine learning needs covers the statistics side.

Classes run live online, so the FinTech and Algorithmic Trading program is open to learners anywhere in India: metros such as Chennai, Hyderabad, Bengaluru and Pune, growing cities such as Coimbatore, Kochi, Indore and Nagpur, and smaller towns such as Ranchi, Patna, Bhubaneswar and Raipur. Classroom batches run in Kolkata, Asansol and Durgapur, and companies can book on-site batches.

Our FinTech and Algorithmic Trading program teaches Python, data, strategy research and honest backtesting over six months. ₹49,999 with No-Cost EMI of ₹10,000 × 6. No profit promises, ever.

SEE THE COURSE

Frequently asked questions

What is backtesting in trading?+

Backtesting means applying a trading strategy's rules to historical market data to see how it would have performed. It helps reject bad ideas cheaply, but results depend on the assumptions used, and a good backtest never guarantees future returns.

Why do backtested strategies fail in live trading?+

Usually because of look-ahead bias, overfitting to past data, survivorship bias, ignoring trading costs and slippage, or testing on too little data from a single market condition. Live markets expose every unrealistic assumption.

What is overfitting in a trading strategy?+

Overfitting means tuning a strategy so closely to past data that it captures random noise instead of a real pattern. It often shows as excellent backtest results with many finely tuned parameters, followed by poor results on new data.

What is walk-forward testing?+

Walk-forward testing repeatedly designs a strategy on one period of data and tests it on the following period, moving forward through time. It mimics how a strategy would actually be developed and traded, and is more honest than a single backtest.

Which language is best for backtesting?+

Python is the most common choice because of libraries such as pandas and NumPy for data handling, plus a large community. What matters more than the language is avoiding biases and modelling costs realistically.

Is algo trading legal for retail investors in India?+

Algorithmic trading is regulated by SEBI, and the rules for how retail investors can use algos through brokers have been changing. Check the latest SEBI circulars and your broker's terms before automating any strategy with real money.

How much data do I need to backtest?+

Enough to include different market conditions, such as rising, falling and sideways periods, and enough trades to be statistically meaningful. A strategy tested on a single good year proves very little.

Where can I learn algorithmic trading in India?+

Careers Ninza's FinTech and Algorithmic Trading program covers Python, market data, strategy research, honest backtesting and risk over six months, live online, with No-Cost EMI. It makes no profit promises.

Related reading

We teach this, live

Every article here comes from something we teach. Sit in on a free masterclass and judge the mentors yourself.