Survivorship Bias in Backtesting: Spot and Fix It
Survivorship bias in backtesting hides delisted stocks and inflates returns. Build a point-in-time universe in Python that keeps the dead companies.

On February 24, 2023, SVB Financial Group filed its annual report: $1.6 billion of net income and diluted earnings of $25.35 per share. Fourteen days later regulators closed its bank. If your backtest universe is a list of tickers that trade today, that company is not in it, and neither is the loss.
That is survivorship bias in backtesting: the test runs on the companies that survived to the present and skips the ones that did not. This tutorial shows how to spot it in your own data with four quick checks, and how to fix it in Python by building a point-in-time universe that keeps delisted companies, keyed by an identifier that does not get reused. The examples are three real exits from 2023, with the filings behind every number.
What survivorship bias does to a backtest
A backtest asks what a strategy would have earned with the information available at the time. The stock universe is part of that information. On any past date, a trader could buy every stock listed that day, including the ones that later went bankrupt, were acquired or were delisted for breaking listing rules. A survivor-only universe removes those names after the fact. The strategy can no longer pick a stock that went to zero, because the stocks that went to zero were deleted before the test began.
The error has a direction. The impact of survivorship bias is higher returns, lower drawdowns and a better Sharpe ratio than the strategy would have produced. Strategies that buy cheap, beaten-down or small companies are hit hardest, because those are the pools the failures come from. It is a different error from look-ahead bias, where a value is used before it was public, and a backtest usually has both. Our guide to point-in-time data for backtesting covers the look-ahead side: restated financials and the reporting lag.
How large is the effect? It depends on the universe and the period. One recent study rebuilt the historical membership of India's NIFTY Smallcap 250 from 2016 to 2025, 1,437 stocks in total, and compared a portfolio of current index constituents with a portfolio of all historical members. The survivor-only version overstated annual returns by 4.94 percentage points and the Sharpe ratio by 0.097. That is one index in one market, not a constant you can subtract from your own results. The only way to know your number is to run the test on a universe that includes the dead.
One more thing before the fix: not every exit is a loss. Activision Blizzard left Nasdaq in October 2023 because Microsoft paid $95.00 in cash for every share. A universe without delisted stocks drops that gain too. Survivorship bias inflates most backtests, but the real damage is that the result no longer describes anything a trader could have done.
How to spot survivorship bias in your own data
You do not need a second data vendor to find out whether your universe is survivor-only. Four checks on the table you already have are enough.
- Look for a company you know is gone. Is SVB Financial Group in your universe on February 27, 2023? Is Activision Blizzard there in September 2023? If a search for either returns nothing, the historical data has been cleaned of delisted companies.
- Count the exit dates. A universe table needs a column that says when each company stopped trading. If the column does not exist, or it is empty for every row, the table can only describe today.
- Count the members per year. Group the universe by year. A survivor-only list gets thinner the further back you go, because it holds only the companies that lasted from then until now. A real universe gains and loses members every year.
- Look up a reused ticker symbol. Ask your data for the history of
BBBY. If one continuous series comes back, two different companies have been merged into one, as shown below.
The same checks apply to an index backtest. Testing a strategy on today's index members over the last ten years is the most common form of the bias: index membership changes every year, and companies leave an index because they shrank, failed or were bought. That needs the historical constituents from the index provider, which the SEC filing record does not contain.
Three delisted stocks and their last 10-K
Here are three companies that left the exchange in 2023, each for a different reason. All three filed a Form 10-K that year, and the figures below come from those filings through /api/financials/income-statement.
| Company | Last 10-K filed | Net income | What happened next |
|---|---|---|---|
SVB Financial Group (SIVB) | 2023-02-24 | $1,609M | Bank closed on 2023-03-10. Common stock cancelled on 2024-11-07 with no payout. |
Activision Blizzard (ATVI) | 2023-02-23 | $1,513M | Acquired by Microsoft on 2023-10-13 for $95.00 in cash per share. |
Bed Bath & Beyond (BBBY) | 2023-06-14 | -$3,499M | Chapter 11 on 2023-04-23. Common stock cancelled on 2023-09-29 with no payout. |
Two of the three were profitable in their last annual report. That is the point a survivor-only universe hides: a screen for profitable companies run in late February 2023 would have passed SVB. Its numbers were fine. The companies that went bankrupt do not all look like Bed Bath & Beyond, with a $3.5 billion loss on $5.3 billion of revenue, before they go.
The statements of a delisted company stay available under its CIK, the number the SEC assigns to each registrant. This is the trimmed response for SVB Financial Group (cik=719739, period=annual):
{
"period": "2022-12-31",
"fiscalYear": 2022,
"fiscalPeriod": "FY",
"dateFiled": "2023-02-24",
"acceptedAt": "2023-02-24T21:43:08Z",
"facts": {
"interestIncomeNet": 4485000000,
"noninterestIncome": 1728000000,
"noninterestExpense": 3621000000,
"provisionForCreditLosses": 420000000,
"incomeBeforeTax": 2172000000,
"netIncome": 1609000000,
"epsDiluted": 25.35
},
"sources": {
"0000719739-23-000021": {
"type": "10-K",
"dateFiled": "2023-02-24",
"acceptedAt": "2023-02-24T21:43:08Z",
"amendment": false
}
}
}Two fields matter for a backtest. acceptedAt is the second SEC EDGAR accepted the filing, in UTC: 21:43 on February 24 is 4:43 p.m. in New York, after the close, so the first session that could trade on this report was Monday, February 27. The key under sources is the accession number of the 10-K, which you can open on EDGAR to check any value. Our post on the point-in-time fundamentals API explains how the same map records restatements.
Ticker reuse: key the universe by CIK, not by ticker symbol
Adding delisted tickers to a ticker list creates a second problem. A ticker symbol identifies a listing only while that listing is active. When a company is gone, the exchange can hand the symbol to someone else.
BBBY is the cleanest recent case. Until 2023 it was the Nasdaq symbol of Bed Bath & Beyond Inc., the home goods retailer. After the bankruptcy, the brand was bought by Overstock.com, a different company with a different CIK. That company renamed itself Beyond, Inc., then Bed Bath & Beyond, Inc., and on August 29, 2025 it began trading on the NYSE under BBBY. On August 17, 2026 it changed again, to Neighborhood Intelligence, Inc. on Nasdaq under NXH.
| CIK | Registrant | Status | Ticker symbols over time |
|---|---|---|---|
| 886158 | Bed Bath & Beyond Inc. (the retailer) | delisted | BBBY (Nasdaq) |
| 1130713 | The former Overstock.com | operating | OSTK (Nasdaq), BYON (NYSE), BBBY (NYSE), NXH (Nasdaq) |
A price or fundamentals history joined on the string BBBY stitches a bankrupt retailer to an online retailer that is still operating. The backtest sees a stock that fell to almost nothing and then came back, which never happened to any shareholder. The CIK does not have this problem: 886158 is the dead company and nothing else. /api/lookup/cik returns a registrant with its current symbols and its priorTickers, and /api/lookup/symbol resolves a ticker to the CIK behind it. The renames, with more examples, are in our ticker symbol change history API guide.
Build a point-in-time universe in Python
The fix is a universe table with one row per company, a permanent key and an exit date, plus a function that answers one question: which companies could I have bought on this day? The code below uses the StockFit API and the requests library. The delisted list is on the Free plan.
Step 1: A small client
import os
from datetime import date, datetime, timezone
import requests
BASE = "https://api.stockfit.io/v1/api"
HEADERS = {"Authorization": f"Bearer {os.environ['STOCKFIT_API_KEY']}"}
def get(path, **params):
response = requests.get(f"{BASE}{path}", headers=HEADERS, params=params, timeout=30)
response.raise_for_status()
return response.json()
def get_all(path, **params):
rows, page = [], 1
while True:
body = get(path, page=page, pageSize=1000, **params)
rows.extend(body["data"])
if page >= body["totalPages"]:
return rows
page += 1Step 2: Active and delisted companies in one table
The survivors come from /api/symbols with status=operating (8,371 stocks on 2026-11-25). The dead come from /api/company/delisted, where each row carries a delistedAt date and the priorTickers the company used. Both lists return the CIK, so the table is keyed by it.
survivors = get_all("/symbols", status="operating", type="stock")
delisted = [row for row in get_all("/company/delisted") if row["type"] == "stock"]
EARLIEST_EXIT = date(1990, 1, 1)
def exit_date(row, today):
day = date.fromisoformat(row["delistedAt"])
if not EARLIEST_EXIT <= day <= today:
raise ValueError(f"implausible exit date {day} for CIK {row['cik']}")
return day
universe = {}
for row in survivors:
universe[row["cik"]] = {"name": row["name"], "tickers": row["symbols"], "exit": None}
today = date.today()
for row in delisted:
try:
day = exit_date(row, today)
except ValueError as error:
print(f"skipped: {error}")
continue
tickers = [ticker["symbol"] for ticker in row["priorTickers"]]
universe.setdefault(row["cik"], {"name": row["name"], "tickers": tickers, "exit": day})The date check is not decoration. Public data is zero-trust: a row with an exit date in the future or decades before your test window should be logged and left out, not silently used. Treat every source the same way, ours included.
Step 3: Confirm the exits that matter
An exit is rarely one clean date. SVB's bank was closed on March 10, 2023, Nasdaq suspended the stock on March 28, and the Form 25 that removed the listing took effect on May 12. The shares then traded over the counter until they were cancelled on November 7, 2024. Which of those dates ends the position is a rule you choose. For the names that move your results, confirm the date against the exchange notice or the 8-K and keep it in a table of your own, with what the holder received:
# Exit rule used here: the day the stock left the exchange.
TERMINAL_EVENTS = {
719739: {"exit": date(2023, 3, 28), "kind": "bankruptcy", "cash_per_share": 0.00},
886158: {"exit": date(2023, 5, 3), "kind": "bankruptcy", "cash_per_share": 0.00},
718877: {"exit": date(2023, 10, 13), "kind": "cash_merger", "cash_per_share": 95.00},
}
for cik, event in TERMINAL_EVENTS.items():
universe[cik]["exit"] = event["exit"]Step 4: The universe on a given day
def universe_on(day):
return {cik for cik, company in universe.items() if company["exit"] is None or company["exit"] > day}
def accepted(period):
return datetime.fromisoformat(period["acceptedAt"].replace("Z", "+00:00"))
def fundamentals_as_of(cik, as_of):
periods = get("/financials/income-statement", cik=cik, period="annual", limit=10)
public = [period for period in periods if accepted(period) <= as_of]
if not public:
return None
return max(public, key=accepted)universe_on handles the exit side: a company is in until its exit date. fundamentals_as_of handles the entry side and the reporting lag in one step. It returns the newest annual report that EDGAR had accepted by as_of, or None when the company had not filed one yet, in which case a fundamentals strategy could not have ranked it that day. How many years come back depends on your plan. Values restated later need one more step, rolling back the before entries, which is worked through in stock backtesting with a full amendment audit trail.
Step 5: Test the universe before you trust it
SVB, ACTIVISION, OLD_BED_BATH = 719739, 718877, 886158
before_failure = universe_on(date(2023, 2, 27))
assert SVB in before_failure
assert ACTIVISION in before_failure
assert OLD_BED_BATH in before_failure
after_failure = universe_on(date(2023, 12, 29))
assert SVB not in after_failure
assert ACTIVISION not in after_failure
report = fundamentals_as_of(SVB, datetime(2023, 2, 27, 14, 30, tzinfo=timezone.utc))
assert report["sources"].keys() == {"0000719739-23-000021"}
assert report["facts"]["netIncome"] == 1_609_000_000
assert get("/lookup/symbol", symbol="BBBY")["cik"] == OLD_BED_BATHThese are the four checks from the top of the post, written as code. Run them against any universe you build, from any source. If the first block fails, the test is survivor-only, whatever the vendor page says.
Delisting returns and terminal events
Including delisted companies fixes the list. It does not yet fix the returns. A position in a company that leaves the exchange has to be closed at what a holder really received, and that depends on why it left. The delisting return is the last piece, and it is the one most often missing from historical data.
- Cash merger. The holder receives the deal price. Activision Blizzard: $95.00 per share on October 13, 2023. Book the cash and reinvest it at the next rebalance.
- Stock merger. The holder receives shares of the acquirer at the exchange ratio in the merger agreement. The position continues under the acquirer's CIK.
- Bankruptcy. The common stock is usually cancelled. Bed Bath & Beyond shares were cancelled without consideration on September 29, 2023, and SVB Financial Group's common stock on November 7, 2024. The final value is zero.
- Move to over-the-counter trading. The stock leaves the exchange but keeps trading. Either follow it with OTC prices or close the position at the exchange exit. Pick one rule and apply it to every case, the wins and the losses.
When the delisting return is missing, the usual shortcut is to drop the stock from the test on its last day of data. That quietly turns a bankruptcy into a sale at the last quoted price, which brings the bias back through a side door. A missing terminal value should stop the run, not pass through it.
This is also where the scope of StockFit ends, and it is better to say so plainly. The API serves the fundamentals and the filing trail of delisted companies, but not their prices: /api/price/history returns a 400 for a delisted listing, so that a reused ticker never returns another company's prices. For the return side of the backtest you need a price source that keeps delisted tickers, joined on the CIK or another permanent identifier, never on the symbol. The event itself is in the filing record: an acquisition or a bankruptcy is reported on Form 8-K, and the exchange removes the listing with Form 25.
A checklist for survivorship bias-free data
Before you trust a backtest result, the data behind it should pass all of these:
- Active and delisted companies are both in the universe, each with an exit date.
- A permanent key, such as the CIK, joins the universe, the fundamentals and the prices. No join runs on the ticker symbol.
- Membership is decided per date: the test asks for the universe on each rebalance day and never uses one list for the whole period.
- Every exit has a terminal value and a reason: cash, acquirer shares or zero.
- Fundamentals are gated on the acceptance time of the filing, which removes look-ahead bias from the reporting lag.
- Index tests use historical constituents, with the dates each member joined and left, not today's index.
- The universe passes spot checks on companies you know failed.
StockFit covers the first, second, third and fifth item for SEC filers: active and delisted companies keyed by CIK, statements with the filing acceptance time, and the accession number behind every value. It does not provide index constituent history or prices for delisted listings. If you are building research infrastructure on top of filings, the data API for hedge funds and quant teams page lists what is included. For a first strategy to run on the universe, the tutorial on how to build a stock screener in Python uses the same statements.
Data verified against the StockFit production API and the cited SEC filings on 2026-11-25. This post is about data and method. It is not financial advice.
FAQ
Q.What is survivorship bias in backtesting?
Q.How do I avoid survivorship bias in a backtest in Python?
Q.How much does survivorship bias inflate backtest returns?
Q.Is including delisted stocks enough to remove survivorship bias?
Q.Why can't I use the ticker symbol to track a stock's history?
Q.What should a backtest do when a stock is delisted?
Ready to build?
Free API key, no credit card.