quantlab.dataset.massive.dividends#

Massive’s dividends and splits as a daily panel on the permaticker axis (#351).

Massive’s /stocks/v1/dividends and /stocks/v1/splits records, as MassiveClient.pull keeps them in the REST raw tier (quantlab.dataset.massive.raw.read_rest_records), become four variables on SEP’s trading calendar, one column per permaticker:

  • dividend_declared: from the trading day of a dividend’s declaration_date through its ex_dividend_date, the declared cash_amount per share. A security with several declared dividends pending shows the one going ex soonest (summed when several go ex that day).

  • dividend_days_to_ex: the trading days from the day to that ex-date, 0 on the ex-date itself; counted on the NYSE calendar, so an ex-date past the store’s last day counts too.

  • dividend_cash: on the ex-date, the cash_amount per share of every dividend going ex that day, summed.

  • split_ratio: on the execution_date, split_to / split_from of every split that day, multiplied (2.0 a two-for-one split, 0.1 a one-for-ten reverse split).

A cell without one is NaN. cash_amount is the amount as declared, never the vendor’s split-adjusted amount, and historical_adjustment_factor is never read: a later event never rewrites the panel’s history. A vendor date that is not a trading day rolls onto the next one, and a dividend declared before the store’s first day is shown from that day.

Each record is placed on the permaticker the Ticker map gives its ticker on the record’s own placement day (the ex-date, the execution date, the first day a declared dividend is shown), through quantlab.dataset.massive.placement.TickerPlacement; a record it cannot place, and a dividend not paid in USD or without an amount, is left out and counted in <store>.unplaced.json. Only the universe’s permatickers (by default SEP’s domestic common stock) are columns.

The store is built through the last day SEP, both REST pulls and the Ticker map all reach, so update() appends a day only once each of them holds it.

Examples#

Build the store and read a declared dividend:

config = MassiveDividendsConfig(
    zarr_file_path="/data/quantlab/market/massive/massive_dividends_1d/massive_dividends_1d.zarr",
    raw_data_dir_path="/data/quantlab/downloads/sharadar",
    massive_dir="/data/quantlab/downloads/massive",
    ticker_map_path="/data/quantlab/market/massive/massive_ticker_map/massive_ticker_map",
    start_date="2016-10-10",
)
panel = MassiveDividendDataset(config).update().panel("2024-01-02", "2024-12-31")
panel["dividend_days_to_ex"].sel(symbol=199059)

Classes

MassiveDividendDataset

Daily panel of Massive's declared and paid dividends and splits, by permaticker.

Functions

usd_dividends

Return the dividends with a USD cash amount and an ex-date; count the others as left out.