quantlab.dataset.massive.permaticker_bars.PermatickerTradeBarDataset#
- class quantlab.dataset.massive.permaticker_bars.PermatickerTradeBarDataset(config, ticker_map=None)[source]#
Bases:
PermatickerDatasetThe one-minute Trade bars on the permaticker axis; see the module docstring.
- Parameters:
- configPermatickerTradeBarsConfig or MassiveTradeBarDataset
The config, or the Trade bar dataset with
ticker_mapbeside it.- ticker_mapTickerMap, optional
The Ticker map, when
configis the Trade bar dataset.
Examples
>>> bars = PermatickerTradeBarDataset(trade_bars, ticker_map) >>> bars.panel("2024-11-27", "2024-11-30")["symbol"].values.tolist() [101, 202, 303, 404, 505]
- 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
MassiveTradeBarDataset
- SOURCE_FIELD = 'trade_bars'#
The config field holding the dataset on the Massive ticker axis.
- config_cls#
The config class used to rebuild this dataset from a saved config.
alias of
PermatickerTradeBarsConfig
- stored_through()[source]#
Return the last day the Trade bar store has converted,
Nonewithout one.Examples
With
trade_barsthe Trade bar store andticker_mapthe Ticker map:PermatickerTradeBarDataset(trade_bars, ticker_map).stored_through() # datetime.date(2024, 11, 29)
- property trade_bars#
The Trade bar dataset on the Massive ticker axis.
Examples
>>> PermatickerTradeBarDataset(trade_bars, ticker_map).trade_bars is trade_bars True