Mattheus Public Preview

Join Waitlist

Mattheus Public Preview

Current Blog

How to Prevent Survivorship Bias in a Trading Backtest

A survivorship-aware backtest rebuilds the investable universe at every decision date and keeps the returns of securities that later disappeared.

Survivorship bias enters a trading backtest when the historical universe contains only the securities that remain visible at the end of the sample. The test then knows which companies, funds, tokens, or venues survived. It excludes many weak assets before the strategy has a chance to select, hold, or lose money on them.

The correction is not a filter applied after the return calculation. It is a point-in-time data problem. For every decision date, the engine must rebuild the assets that were actually eligible then. It must also preserve later exits, name changes, mergers, bankruptcies, and delisting outcomes. The result may be less attractive, but it answers the intended historical question.

Why a current constituent list changes history

Suppose a researcher tests a stock rule from 2010 through 2025 using the companies in an index today. Every selected company is known to have survived long enough to reach the present list. Companies removed after distress, acquisition, or changing eligibility are absent. The universe has been chosen with information that was unavailable in 2010.

This is related to look-ahead bias, but it deserves its own control. A price series can contain no future bars and still be biased if the security list came from a later date. How to Prevent Look-Ahead Bias in a Trading Backtest covers the wider rule that every input must be available before the simulated decision.

Membership changes for many reasons. Investor.gov explains that an exchange may remove a stock when it no longer meets continued listing standards. Other securities disappear after mergers, liquidations, or voluntary withdrawals. A backtest needs the historical membership record and the economic outcome after each exit. A final price row alone does not always provide either one.

Build the universe at each decision date

Define eligibility as a dated rule. If the strategy trades an index, store each addition and removal with the date on which the change became effective. If it trades a screen, calculate the screen from records that were available on that date. Do not replace either process with today's index members or today's database coverage.

Represent membership as intervals rather than one current flag. Each record should identify the security, the start of eligibility, the end of eligibility, the source, and the date when the source became available. The backtest should query the interval that contains the decision timestamp.

A small delay may be needed between an announced index change and an executable trade. Write that rule down. Using the effective date, announcement date, or next market open can produce different holdings. The correct choice follows the strategy specification, not the result that looks best.

Count the eligible assets on every rebalance date. Sudden unexplained drops often reveal missing archives or an incorrect join. Compare additions and removals with the source record. Store the comparison beside the run so another researcher can inspect the universe that produced each order.

Use stable identifiers instead of tickers

A ticker is a label, not a permanent identity. Companies can change tickers. A ticker can later be reused by an unrelated issuer. Share classes can merge or split. Joining long histories on the visible symbol can attach one security's earlier data to another security's later data.

Use a stable security identifier as the primary key. Keep ticker, issuer name, exchange, share class, and identifier mappings in dated tables. A symbol change should update the label without creating a new economic asset unless the underlying security changed.

Corporate actions need their own records. A merger can produce cash, replacement shares, or both. A liquidation can make distributions after the last exchange trade. The portfolio ledger should apply those events on their effective dates instead of silently dropping the position.

Data Lineage for Trading Research explains how to attach the source, ingestion time, transformation, and code revision to every research output. That history is especially important when an identifier mapping or corporate action is corrected after a backtest ran.

Keep delisted securities and terminal outcomes

A delisted security should not vanish at its last quoted close. The CRSP Data Description Guide defines a delisting return by comparing the value after delisting with the security's last trading price. That later value may come from an off-exchange price, a quote, or distributions paid to shareholders. CRSP also notes that a missing value is reported when the available information is insufficient.

Tyler Shumway's study of CRSP data documented that omitted returns for many negative delistings were large. The finding matters because exclusion does not create neutral missingness. Poor outcomes are more likely to disappear from an incomplete dataset, which can raise the apparent performance of a strategy that owned them.

Keep the final exchange return, delisting code, delisting date, terminal value, later distribution, and the date each item became known. Combine the ordinary return and the delisting return according to the data provider's documented method. Do not assume that zero, minus one hundred percent, or the last close is correct for every missing outcome.

When a delisting return is missing, state the policy before measuring performance. Options include excluding the affected strategy run, reporting bounds, using a published estimate for a defined code group, or flagging the result as incomplete. The chosen treatment should appear in sensitivity results. A hidden fill value makes the backtest hard to audit.

The SEC provides Form 25 and Form 25-NSE searches for issuer and exchange delisting notices. These records can help verify that an exit occurred. They do not by themselves provide every terminal return or distribution, so event evidence and economic outcome data should remain separate.

Distinguish a dead security from a data gap

A missing price can mean no trade, a suspended market, a stale feed, an identifier error, or a security that no longer exists. Treating every gap as an exit can create false losses. Forward-filling every gap can create fictitious liquidity.

Classify the gap with event data. Record trading status, venue status, last trade, delisting notice, corporate action, and any later payment. The execution model should stop opening new positions when the asset becomes ineligible. Existing positions should follow the documented exit path.

Apply costs and liquidity constraints to securities that later failed. A failing asset may have a wide spread, little volume, or no executable quote near the exit. How to Model Trading Costs in a Backtest describes how fees, spread, slippage, funding, and fill rules belong inside the simulated order path.

Test the survivorship controls

Run a reconciliation before evaluating the strategy. For each rebalance date, verify the eligible count, additions, removals, missing-price count, and open positions in removed securities. Sample several assets that failed, merged, changed symbols, and survived. Trace each one from eligibility through its terminal portfolio value.

Compare two intentionally different runs. One uses the point-in-time universe. The other uses the final survivor list. The second run is not a valid performance estimate. It is a diagnostic that shows how much the universe choice changes holdings, turnover, return, and drawdown for this strategy and sample.

Do not use that difference as a universal adjustment. Survivorship bias depends on the market, period, weighting, selection rule, and exit policy. Rebuild the universe rather than adding a fixed haircut to an invalid result.

Keep strategy selection separate from this data correction. A clean universe does not prevent the researcher from choosing the best rule after testing many candidates. How to Detect Backtest Overfitting describes the trial ledger and held-out evidence needed for that problem.

Store a reproducible universe record

The final research package should contain the dated membership table, stable identifiers, symbol history, corporate actions, delisting events, terminal outcomes, missing-value policy, cost model, source versions, and reconciliation results. It should also store the exact universe returned at every decision time.

Label remaining limits plainly. A provider may lack older membership announcements, off-exchange prices, foreign listings, or complete distributions. The backtest can report those gaps without pretending they are solved.

Historical repair is only one layer of evidence. Freeze the universe logic and collect new decisions after the research period ends. Why Mattheus Starts Paper-First explains how forward observation separates live decision records from the history used to build the strategy.

Invest and Earn Yield with Infinite Context.

Invest and Earn Yield with Infinite Context.

An AI harness that remembers how you trade.

An AI harness that remembers how you trade.

An AI harness that remembers how you trade.

Public preview · Join the waitlist

Dashboard interface preview
Dashboard interface preview