quantlab.universe#

Point-in-time US equity symbol universe, free of survivorship bias.

A universe is the list of symbols a strategy may consider. It is point-in-time when it answers “which symbols existed, or belonged to an index, on this date” rather than “which symbols exist today”. Using today’s list for a past date causes survivorship bias: companies that later went bankrupt or were delisted are missing, so the backtest only ever sees the survivors and looks better than it should.

This module builds and queries a reference table that answers the point-in-time question for US stocks. Two kinds of fetcher produce its rows. TiingoRosterFetcher subclasses (NasdaqUniverseFetcher, USEquityUniverseFetcher) download exchange-wide rosters of common stock, delisted names included, from the ticker directory of the market-data vendor Tiingo. IndexMembershipFetcher subclasses (SP500MembershipFetcher, Nasdaq100MembershipFetcher) rebuild the dates each stock joined and left an index from a snapshot of today’s members plus Wikipedia’s historical change log. UniverseCatalog merges both into one parquet table with the columns symbol, category, start_date, end_date and end_date_is_inferred, and answers point-in-time queries against it.

See docs/user-guide/universes.md for a guide.

Classes

IndexMembershipFetcher

Base class for rebuilding the dates each stock was in an index.

Nasdaq100MembershipFetcher

Point-in-time Nasdaq-100 membership from a scraped anchor and Wikipedia.

NasdaqUniverseFetcher

Roster of every NASDAQ-listed common stock, delisted names included.

SP500MembershipFetcher

Point-in-time S&P 500 membership from a GitHub CSV anchor and Wikipedia.

TiingoRosterFetcher

Base class for exchange-wide common-stock rosters built from Tiingo.

USEquityUniverseFetcher

Roster of US common stock listed on NYSE, NASDAQ and AMEX, priced in USD.

UniverseCatalog

Point-in-time reference table of US equity universes.

UniverseConfig

Config of the point-in-time universe catalog builder.