quantlab.dataset.massive.day_bars.MassiveDayBarDataset#

class quantlab.dataset.massive.day_bars.MassiveDayBarDataset(dataset_config)[source]#

Bases: StockDataset

Dense Day aggregate panel on the Massive ticker axis; see the module docstring.

Parameters:
dataset_configMassiveDayBarsDatasetConfig

The raw tier, the store and the date range.

Examples

With config a MassiveDayBarsDatasetConfig of a raw tier on disk:

ds = MassiveDayBarDataset(config).update(granularity="day")
list(ds.panel("2024-11-26", "2024-11-29").data_vars)
# ['open', 'high', 'low', 'close', 'volume', 'n_trades']
DATA_TYPE = 'day_aggs'#

The data type the panel is built from.

DEFAULT_RESAMPLE_HOW = {'close': 'last', 'high': 'max', 'low': 'min', 'n_trades': 'sum', 'open': 'first', 'volume': 'sum'}#

resample(freq) aggregates each variable this way unless told otherwise.

NEW_LISTING_STRATEGIES = ('refuse', 'widen')#

No "rebuild": a ticker a new day brings has no bar before it, so the store is only refused or extended.

config_cls#

The config class used to rebuild the dataset from a saved config.json.

alias of MassiveDayBarsDatasetConfig

has_raw_data()[source]#

Return whether the raw tier holds at least one day-aggregate file.

Examples

With config a MassiveDayBarsDatasetConfig of a raw tier on disk:

MassiveDayBarDataset(config).has_raw_data()
# True
stored_through()[source]#

Return the last day the store holds, from its chunk ledger, or None without one.

Examples

With config a MassiveDayBarsDatasetConfig of a raw tier on disk:

MassiveDayBarDataset(config).update(granularity="day").stored_through()
# datetime.date(2024, 11, 29)