quantlab.dataset.sharadar.membership#
Point-in-time S&P 500 membership from Sharadar’s SP500 table, keyed by permaticker.
The SP500 table records each change to the index: an added or removed
row whose date is the effective membership date (not the announcement),
plus a historical snapshot of every member at each calendar quarter end
and a current snapshot dated on the vendor’s last refresh. Tickers are
Sharadar’s current identifiers, so a renamed company’s history sits under
its present ticker and maps to one permaticker through TICKERS.
A stock is a member from its added date and is no longer one on its
removed date, so a spell ends the day before the removal. The changes go
back to the index’s launch in 1957, but Sharadar’s prices (and so its
permatickers) start on PIT_COVERAGE_START, 1997-12-31: a spell that ended
before then is dropped, whether or not the company kept trading, and the
panel answers membership from that date. So a roster (roster_universe)
is the same whether its window starts before or on that date. A former member Sharadar never priced is dropped
with a warning naming it; a member to the table’s end without a permaticker
is refused, because it means TICKERS is older than SP500. A member whose first recorded change is a removal
is taken as a member since PIT_COVERAGE_START; a member with no change at
all was in the index throughout. Every spell ends by the table’s last date, so a panel
built from the same raw file is the same whenever it is built.
Examples#
>>> config = FileConstituentDatasetConfig(
... zarr_file_path="/data/universe/sharadar/sharadar_sp500_membership/sharadar_sp500_membership.zarr",
... cache_dir="/data/downloads/sharadar",
... start_date="2015-01-01",
... )
>>> panel = SharadarSP500ConstituentDataset(config).from_raw_data().get_xarray_dataset()
>>> panel["symbol"].dtype
dtype('int64')
Classes
Daily point-in-time S&P 500 membership panel on the permaticker axis. |
Functions
Return every S&P 500 membership spell in the raw SP500 table. |