bias free backtesting explained how sharpely uses point in time data to avoid look ahead and survivorship bias
Backtesting sounds simple. You take a strategy, apply it to past data, and see how it would have performed. If the returns look good, you feel confident. But here’s the problem — many backtests look good only because they are unfair.
A biased backtest is like playing a cricket match with a baseball bat instead of a cricket bat. You might score a lot of runs, but the game itself has become unpredictable and unrealistic. In investing, this kind of unfair advantage makes strategies look powerful on paper but weak in real life. At sharpely, we design backtests to be realistic, even if that means the results look less impressive.
In very simple words, bias means cheating without realising it. A backtest becomes biased when it uses information that an investor could not have known at that time, or when it quietly ignores uncomfortable parts of history. Many investing platforms (very reputed ones!) unintentionally allow this because building bias-free systems is hard and requires very high-quality data and careful design.
When bias enters a backtest, the results stop reflecting reality. Instead of showing what could have happened, they start showing what looks good in hindsight. That is why understanding bias is far more important than chasing high backtested returns.
sharpely uses what is called a historical walk-forward backtest, which is the most accepted way professionals test strategies. Imagine walking step by step through history instead of jumping straight to the end. At every step, decisions are made using only the information that was available at that time.
The portfolio is then carried forward until the next rebalancing date, where the same process repeats. There is no jumping ahead and no peeking into the future. This method closely mirrors how real investors experience markets over time.
Look-ahead bias happens when a backtest uses information before it was actually available. This is one of the most common mistakes, and many platforms suffer from it without even realising.
For example, suppose a strategy selects stocks with the highest quarterly EPS growth and rebalances on 31 March. The problem is that companies usually announce March quarter results in April or May. If a backtest uses March EPS data on 31 March, it is using future information, which makes the results unreliable.
At sharpely, financial data is added only after it is officially reported. If a company announces results on 6 May, the data becomes usable only from that date, not earlier. This point-in-time approach removes look-ahead bias and keeps the backtest honest.
Another common issue is assuming that portfolio decisions and trades happen on the same day. Many platforms make this assumption, even though it is not practically possible.
If you decide which stocks to buy based on today’s closing price, you cannot also buy them at that same price. At sharpely, portfolio decisions are made on the rebalancing day, but trades are executed using next day prices.
For stocks and ETFs, this is done using the average of the next day’s open, high, low and close, while for mutual funds, the next day’s NAV is used. This small detail makes a big difference in realism.
Survivorship bias occurs when backtests include only companies that exist today and ignore those that failed in the past. Many platforms unknowingly introduce this bias, which makes historical performance look much safer than it actually was.
In real markets, some companies get delisted, merged, or go bankrupt. At sharpely, we maintain historical records of instruments that existed at each point in time. During backtesting, strategies can pick stocks that were available on that date, even if they were later delisted. If a stock gets delisted during a holding period, it is assumed to be sold at the last available price, just like a real investor would experience.
Indices like NIFTY 50 or sector indices change over time. Stocks enter and leave these indices regularly. However, many platforms backtest incorrectly by using today’s index constituents when testing past performance.
At sharpely, index-based backtests use historical index membership. This means that if a stock was not part of an index in 2015, it will not appear in a 2015 backtest — even if it is part of the index today.
Example:
A stock that is currently not in Nifty 50 index but was in NIFTY 50 in 2018 will appear in a NIFTY 50 backtest trade log of 2017.
This avoids another subtle but powerful source of bias that exists on many platforms. Platforms like Trendlyne backtest strategies based on the current constituents of Index. This approach will result in false backtesting results.
By default, sharpely does not assume dividend reinvestment in screen or basket backtests. Prices are adjusted for splits, bonuses, and rights issues, but not for dividends. This means the backtest may look slightly understated compared to benchmarks like NIFTY TRI.
This is a deliberate choice. We believe that a conservative backtest is more useful than an inflated one. Individual stock, ETF, and mutual fund performance is still shown with dividends included — this conservative approach applies specifically to strategy backtesting.
A bias-free backtest may not look exciting at first glance. The returns may appear lower and the equity curve may look less smooth. But what it gives you is something far more valuable: trust and accuracy.
When a backtest is honest, you can focus on understanding the strategy rather than doubting the numbers. At sharpely, backtesting is designed to answer a simple question: Could this strategy have realistically worked, given what investors knew at that time?
And that makes all the difference.
Ans: Backtesting is the process of testing an investment strategy on historical data to see how it would have performed in the past. It helps investors evaluate strategies before using real money. However, the reliability of a backtest depends heavily on whether it is free from biases.
Ans: Bias in backtesting refers to any flaw that makes historical performance look better than what an investor could realistically achieve. Common biases include using future information, ignoring failed companies, or assuming impossible trade execution prices.
Ans: Look-ahead bias occurs when a backtest uses information that was not available at the time of making an investment decision. For example, using quarterly earnings data before the company has officially reported results leads to unrealistic and inflated backtest performance.
Ans: Survivorship bias happens when backtests include only companies that exist today and exclude those that were delisted, merged, or went bankrupt in the past. This makes historical returns appear safer and higher than what real investors would have experienced.
Ans: Point-in-time data ensures that only information that was actually available on a specific historical date is used in a backtest. Financial data is made available only after its official reporting date, helping eliminate look-ahead bias.
Ans: Without point-in-time data, backtests may unknowingly use future information, resulting in misleading performance. Point-in-time data makes backtests more realistic and closer to what an investor could have achieved in real life.
Ans: Yes. sharpely uses point-in-time, as-reported fundamentals with realistic reporting lags. This means financial data is included in backtests only after it becomes publicly available, helping avoid look-ahead bias.
Ans: Yes, sharpely maintains historical universes that include stocks which were later delisted or merged. During backtesting, strategies can only select instruments that existed on the rebalancing date, reducing survivorship bias.
Ans: By default, backtests on sharpely do not assume dividend reinvestment. This conservative approach prevents inflated results. However, individual stock, ETF, and mutual fund performance on sharpely is shown after adjusting for dividends.
Ans: No. Backtesting only shows how a strategy would have performed in the past. Even a bias-free backtest cannot guarantee future performance, but it provides a much more reliable starting point than a biased one.
Ans: Yes. Bias-free backtesting helps long-term investors understand how a strategy behaves across different market cycles and prevents false confidence built on unrealistic historical results.