quantlab.dataset.sharadar.daily#
Sharadar DAILY valuation panel (market cap, EV, PE, PB, PS), keyed by permaticker.
DAILY holds one row per company and trading day: marketcap, ev and
the valuation ratios evebit, evebitda, pb, pe and ps. The
vendor computes them from the price of the day and the most recent SEC
filing (as reported), so a row uses nothing later than its date.
SharadarDailyDataset converts the raw tier into a dense
(timestamp, symbol) Zarr panel on DAILY’s own dates whose symbol
coordinate is the int64 permaticker, as the price and fundamentals panels’
is. TICKERS has no rows of DAILY, which covers SF1’s filers, so its tickers
are mapped through the SF1 rows. The conversion refuses a raw ticker TICKERS
does not know, a ticker TICKERS maps to two permatickers, and two rows of one
permaticker on one date.
The vendor writes marketcap and ev in USD millions, but SF1 writes
them in USD; the panel holds them in USD (MILLIONS), so merging the two
never mixes units. Each variable records its unit in its unit attribute
(USD or ratio), from INDICATORS. The store grows with update():
new days are appended and a stored day is never rewritten, so a value the
vendor changes later (DAILY rows are refreshed by lastupdated,
SharadarClient.updated_table) never reaches the store.
Examples#
Build the store from a downloaded raw tier and read a week:
config = SharadarDailyConfig(
zarr_file_path="/data/quantlab/market/sharadar/sharadar_daily_1d/sharadar_daily_1d.zarr",
raw_data_dir_path="/data/quantlab/downloads/sharadar",
)
SharadarDailyDataset(config).update()
panel = SharadarDailyDataset(config).panel("2024-01-02", "2024-01-08")
panel["marketcap"].attrs["unit"] # 'USD'
Classes
Dense daily panel of Sharadar's DAILY valuations, keyed by permaticker. |