Technical analysisModule 6, lesson 30 of 32
Survivorship, look-ahead and other backtesting biases
How survivorship bias, look-ahead bias, data errors, unrealistic fills and ignored costs each inflate backtest results, with examples of how to spot and avoid them.
In this lesson
- Explain survivorship bias and how it inflates backtests.
- Explain look-ahead bias and recognise common ways it creeps in.
- Recognise data errors, unrealistic fills and ignored costs.
- Apply a checklist to judge whether a backtest is realistic.
Builds on
- BacktestingThis lesson examines the ways the backtests described there go wrong.
On this page
In simple terms
A backtest uses real historical prices, so it is tempting to assume its results are realistic. They often are not. Several well-known biases make backtests look better than any trader could have done in reality. The misleading backtests lesson introduced them from an investor's point of view; this lesson looks at them from the side of someone building a test.
Survivorship bias
Survivorship bias arises when a test uses only shares that exist today, or that are in an index today. Companies that went bankrupt, were delisted or fell out of the index are missing. A trader at the time would have bought some of them.
Worked example: How survivors flatter a test
A made-up test applies a buying rule to the 50 companies in an index today, over the last ten years. Suppose that ten years ago, 12 different companies were in the index; since then some of them have collapsed or shrunk and been replaced.
| Average yearly return of the strategy on today's 50 members | 16% |
|---|---|
| Average yearly return on the members as they were at each date, including those later removed | 10% |
These figures are made up, but the direction is typical: testing only on survivors leaves out the losers that the rule would have bought.
The fix is point-in-time data: the list of shares that were actually available, or in the index, on each past date, including those since delisted.
Look-ahead bias
Look-ahead bias arises when the test uses information that was not available when the trade would have been made. It creeps in through:
- Same-bar execution: generating a signal from today's close and assuming you bought at that same close. You could only have bought at the next available price.
- Fundamental data: using a year's results on the first day of the next year, before they were published, as the misleading backtests lesson explains.
- Revised data: using figures that were later restated.
- Index membership: choosing shares by today's index, which is itself information from the future.
- Parameter choices: choosing settings by looking at the whole period's results, discussed in the overfitting lesson.
Data problems
- Unadjusted prices: splits and bonus issues appear as crashes, triggering false signals, as the adjusted prices lesson explains.
- Missing dividends: strategies that hold shares miss part of their return; strategies that sell before ex-dates may look better than they were.
- Bad ticks: erroneous prices in the data, such as a single trade at a wildly wrong price, can create profits that never existed.
Unrealistic execution
- Fills at the exact signal price ignore the spread and slippage.
- Unlimited size: assuming you could buy any quantity at the quoted price, even in thinly traded shares.
- Gaps: assuming stops fill at their trigger, when gaps would have filled them much worse, as the price gaps lesson shows.
- Price bands and circuit limits: assuming you could sell a share locked at its lower circuit, when in reality there were no buyers.
Ignored costs
Brokerage, taxes, exchange charges, the spread and slippage are paid on every trade, as the backtesting lesson explains. Leaving them out is the simplest way to make a weak strategy look strong.
A checklist for any backtest
| Question | Bias it checks |
|---|---|
| Does the universe include shares later delisted or removed? | Survivorship |
| Are trades executed at a price available after the signal? | Look-ahead |
| Is every piece of data used only after it was published? | Look-ahead |
| Are prices adjusted and dividends handled? | Data errors |
| Are spreads, slippage, gaps and size limits modelled? | Execution |
| Are all costs and taxes included? | Costs |
| Were settings chosen without looking at the whole test period? | Overfitting |
Why it matters
Each bias pushes results in the same direction: better than reality. Together they can turn a losing idea into an apparently excellent one. Knowing them lets you build fairer tests yourself and see through the impressive backtests used to sell courses and strategies.
Limitations
Some biases are hard to remove completely: point-in-time data for delisted shares can be hard to obtain, and slippage can only be estimated. Even a bias-free backtest describes the past, not the future.
Common mistakes
- Testing on today's index members.
- Trading at the close that generated the signal.
- Using unadjusted data.
- Assuming any size fills at the quoted price.
- Leaving out costs.
Try it yourself
- Take a backtest result you have seen, in a course, video or article.
- Work through the checklist and note which questions the source answers.
- For each unanswered question, write down which way the bias would move the result.
- Decide how much of the claimed result you would still believe.
Key takeaways
- Survivorship bias comes from testing only on shares that still exist today, leaving out the failures a real trader could have bought.
- Look-ahead bias comes from using information that was not available at the time of a trade, such as later results, revised data or the same day's close.
- Data errors, unadjusted prices and missing corporate actions create false signals and false profits.
- Assuming every order fills at the signal price, in any size, ignores spreads, slippage, gaps and price bands.
- A backtest built on real historical data can still be unrealistic. Check each bias before trusting any result.
Check your understanding
Finished reading?
Your progress is saved only in this browser.
Terms used in this lesson
- Survivorship bias
- The error of judging something by the examples that survived or succeeded, while ignoring the many that failed and dropped out of view.
- Look-ahead bias
- An error in a backtest that uses information not available at the time of a trade, such as later results, revised data or the same day's close.
- Backtest
- A test of how a set of trading or investing rules would have performed on past prices, as if they had been followed at the time.
- Slippage
- The difference between the price you expected when placing an order and the average price you actually got.
Spotted a mistake or something unclear? Report it by email. Here is how corrections work.
This lesson is general education, not investment advice. Examples use made-up or clearly dated figures to explain ideas; they are not recommendations. Read the disclaimer.