Objective
The introductory backtesting lesson named look-ahead and survivorship bias. Here the aim is to size them: given a description of a backtest, estimate in return or Sharpe terms how much each bias flatters it, and know which strategies each bias hurts most.
Look-ahead: data that did not exist yet
Beyond the missing-lag case, the costly forms are about when data became known:
- Reporting lags. Quarterly fundamentals are released weeks after quarter end. A backtest that uses them from the quarter-end date trades ahead of the announcement.
- Revisions. Macro series and restated accounts differ from what was first published. Use first-release (vintage) data.
- Timestamps. A news item or earnings release dated "day " may have arrived after the close; it can only be traded on day .
- Full-sample transforms. Z-scores, regression betas, PCA factors, and hyperparameters chosen on the whole sample.
Sizing: if the leaked information is an announcement, the backtest earns part of the announcement move, which can dwarf any real edge.
Survivorship
A universe built from today's constituents omits names that were delisted. If a fraction of the universe delists each year with average delisting return , an equal-weighted backtest on survivors is overstated by roughly per year (the omitted returns, plus the replacement by stocks that did survive). The damage concentrates in strategies that buy distress: small caps, value, short-term losers. Survivorship also afflicts fund databases, futures roll schedules built from today's liquid contracts, and "current index members" lists.
Selection and data snooping
Selection bias is choosing the sample by its outcome: testing on the sector where the idea is known to work, dropping a crisis year as an "outlier", or starting the backtest after a bad stretch. Data snooping is the same at the level of the research community: if a pattern has been mined by many researchers on the same data, your "first test" is the latest of many. Both are multiple testing in disguise, sized by the expected-maximum calculations of the previous lessons, and both are reduced by fixing the sample before looking.
Timing of fills
A backtest has to say exactly at which price each order is filled:
- Same-bar execution. A signal computed from the close cannot trade at that close unless it is computed before the auction cut-off from data available then.
- Bid-ask bounce. Closing prints sit at the bid or the ask. A reversal strategy that "buys" stocks that closed down is often buying prints at the bid, a price it could not get as a buyer. In Roll's model, observed price changes have autocovariance for a spread , so negative autocorrelation in prices is partly an artefact; it also gives an estimate .
- Limit orders. Assuming every limit order fills when the price touches it ignores queue position and adverse selection: the fills you get are disproportionately the ones you would rather not have.
Stale prices
Illiquid assets (small caps, corporate bonds, private assets, emerging markets after another market's close) carry prices that have not updated. Two effects:
- Smoothed returns understate volatility. If the reported return is , its variance is while its mean is unchanged, so the naive Sharpe ratio is inflated by . The tell is positive autocorrelation, at lag 1.
- Predictability you cannot trade. Stale prices lag the market, so a signal based on the latest market move "predicts" them. The backtest trades at the stale price; in reality no one will sell at it.
Worked example
sizing three biases
Estimate the bias in each case. (a) A small-cap value backtest on today's index members, where 10% of names per year historically delisted with an average delisting return of −30%. (b) An earnings-surprise strategy that uses quarterly data from the quarter-end date. Announcement-day returns are roughly , the strategy has perfect knowledge of the surprise sign, and each stock reports four times a year. (c) Daily returns of a stock have lag-1 autocovariance ; what spread does Roll's model imply, and how does that compare with a reversal backtest earning 10 basis points per trade at closing prints?
Show solutionHide solution
(a) Survivorship. Roughly per year is missing from the losses. For a strategy with a gross premium of 4% to 6%, that is half or more of the claimed edge.
(b) Reporting-lag look-ahead. Knowing the sign of the surprise in advance lets the strategy earn the absolute announcement move. For a normal with standard deviation 5%, per announcement, about a year per stock position. The real post-announcement drift is a small fraction of this, so the backtest is dominated by the leak.
(c) Bid-ask bounce. , i.e. 30 basis points. Buying at the bid and selling at the ask, as closing prints allow on paper, captures up to a full spread that a real trader pays instead. A reversal "edge" of 10 basis points per trade is a third of the spread: it is plausibly entirely bounce.
Worked example
stale prices flatter the Sharpe ratio
An asset's true monthly returns have mean 0.5% and volatility 3% (annualised Sharpe ). The reported return blends 70% of this month's true return with 30% of last month's. What Sharpe ratio does a naive calculation report, and what autocorrelation gives it away?
Show solutionHide solution
With the variance factor is , so reported volatility is times the true value. The mean is unchanged, so the naive Sharpe is , inflated by 31%. The lag-1 autocorrelation is .
import random, statistics as st
random.seed(2)
theta, months = 0.3, 120_000
mu, sigma = 0.005, 0.03 # true monthly mean and vol: SR = 0.577 annualised
true = [random.gauss(mu, sigma) for _ in range(months)]
# Reported return mixes this month's true return with last month's (stale marks).
rep = [(1 - theta) * true[t] + theta * true[t - 1] for t in range(1, months)]
def ann_sharpe(x):
return st.mean(x) / st.stdev(x) * 12 ** 0.5
def lag1_corr(x):
return st.correlation(x[:-1], x[1:])
print(f"true Sharpe: {ann_sharpe(true[1:]):.2f}")
print(f"reported Sharpe: {ann_sharpe(rep):.2f}")
print(f"lag-1 autocorrelation of reported returns: {lag1_corr(rep):.2f}")
This prints , and . The fix is to annualise with the autocorrelation included (the long-horizon variance of the smoothed series equals the true one, because the weights sum to 1) or to desmooth the returns before computing risk.
Knowledge check
Reported monthly returns are 80% this month's true return plus 20% last month's. By roughly how much does the naive Sharpe ratio overstate the true one?
Knowledge check
A macro strategy uses GDP growth as published in today's database for each historical quarter. What is the main problem?
Knowledge check
Under Roll's model, a stock's daily price changes have lag-1 autocovariance of (in squared dollars). What is the implied bid-ask spread?
Key takeaways
- Ask when each input became known: reporting lags, revisions and timestamps leak more than missing lags.
- Survivorship costs roughly delisting rate times delisting loss per year, concentrated in strategies that buy distress.
- Selection and data snooping are hidden multiple testing; fix the sample before looking.
- Specify every fill price; closing prints and touch-filled limit orders hand the backtest the spread.
- Stale prices understate volatility by and create predictability you cannot trade; positive autocorrelation is the tell.
Practice problems
Finished reading?
Answer the 3 knowledge checks to complete this lesson (0 done).