quantlab.dataset.sharadar.tickers#
The ticker sidecar of a Sharadar store: permatickers shown as the ticker in use that day.
A Sharadar panel’s symbol axis is the permaticker, Sharadar’s unchanging
integer id of one share class: right for code, but not what a person reads in
a backtest’s Holdings tab or its settlements.json. Sharadar renames a
security’s whole history to its current ticker, so the price table alone
never says that permaticker 194817 traded as FB before it was META. The
names come from two raw tables:
TICKERS gives each permaticker its current ticker and company, from the rows labelled with the store’s table (
SEPorstocksfor SEP), so a fund’s row never names a stock;ACTIONS gives each ticker change as a
tickerchangefromrow: on itsdatethe security, then trading ascontraticker(companycontraname), becameticker.
ticker_sidecar_payload builds, for given permatickers, a list of spans
per permaticker (the first day each ticker was in use, null for the
first), and SharadarTickerLookup answers “which ticker and company did
this permaticker have on this day” from the JSON file
<store>.sharadar_tickers.json beside the store. A conversion of
SharadarStockDataset writes the file; write_ticker_sidecar and
scripts/sharadar/ticker_sidecar.py write it for an existing store.
The lookup is for display: names never raises. A permaticker the file
does not know reads as its own id; so does every permaticker when the file is
missing or damaged, with one warning per lookup object.
Examples#
>>> lookup = SharadarTickerLookup("/data/market/sharadar/sharadar_sep_1d/sharadar_sep_1d.zarr.sharadar_tickers.json")
>>> lookup.label([194817], date(2022, 6, 8)), lookup.label([194817], date(2022, 6, 9))
(['FB'], ['META'])
Classes
The ticker and company a permaticker had on a day, from one |
Functions
Return the ticker sidecar of |