quantlab.dataset.massive.mapped_bars.MappedTradeBarDataset#

class quantlab.dataset.massive.mapped_bars.MappedTradeBarDataset(config)[source]#

Bases: MappedPermatickerDataset

Trade bars on permatickers, read from a store the view writes; see the module docstring.

Parameters:
configMappedTradeBarsConfig

The view (source, a PermatickerTradeBarDataset) and the store.

Examples

>>> mapped = MappedTradeBarDataset(MappedTradeBarsConfig(source=bars, zarr_file_path="mapped.zarr"))
>>> mapped.update().panel("2024-11-27", "2024-11-30")["symbol"].values.tolist()
[101, 202, 303, 404, 505]
BATCH_DAYS = 2#

Session days mapped and appended per write: a whole-market day is about 0.8 GB, and a batch mapped in a worker travels back pickled.

DEFAULT_RESAMPLE_HOW = {'buy_volume': 'sum', 'close': 'last', 'close_auction_price': 'last', 'close_auction_volume': 'sum', 'dollar_volume': 'sum', 'high': 'max', 'low': 'min', 'n_trades': 'sum', 'oddlot_volume': 'sum', 'offexchange_volume': 'sum', 'open': 'first', 'open_auction_price': 'first', 'open_auction_volume': 'sum', 'sell_volume': 'sum', 'volume': 'sum'}#

resample(freq) aggregates each variable as the Trade bars do.

SOURCE_CLS#

alias of PermatickerTradeBarDataset

config_cls#

The config class used to rebuild this dataset from a saved config.

alias of MappedTradeBarsConfig