quantlab.dataset.config.NbboBarsDatasetConfig#

class quantlab.dataset.config.NbboBarsDatasetConfig(*, zarr_file_path, start_date=None, end_date=None, symbols=None, kwargs=None, resample_freq=None, resample_how=None, name=None, raw_data_dir_path, market='us_equity', frequency='1m', vendor='wrds', reference_dir, permnos=None, session_start='09:30', session_end='16:00', drop_crossed=True, drop_locked=False, drop_nonpositive_price=True, keep_qu_cond=None)[source]#

Bases: DatasetConfig

Config of the NBBO bar panel built from bars resampled on the WRDS server.

The raw tier already holds bars, so frequency is the bar size itself; there is no bar_interval field. The session window and the four filter fields carry the same meaning as on NbboDatasetConfig, but they were applied on the WRDS server when the bars were downloaded: the conversion refuses a config whose values differ from the settings recorded with the raw tier, rather than labelling bars with filters they were not built with. The symbol axis is the PERMNO, as for NbboDatasetConfig. See docs/user-guide/wrds.md.

Examples

>>> cfg = NbboBarsDatasetConfig(
...     zarr_file_path="/data/us_equity/1m/nbbo_server_1m.zarr",
...     raw_data_dir_path="/data/downloads/wrds",
...     reference_dir="/data/downloads/_reference",
...     start_date="2024-01-02",
...     end_date="2024-01-31",
...     permnos=("14593",),
... )
>>> cfg.frequency, cfg.session_start, cfg.drop_crossed
('1m', '09:30', True)
drop_crossed = True#

The server dropped records whose bid exceeds the ask.

drop_locked = False#

The server dropped records whose bid equals the ask.

drop_nonpositive_price = True#

The server dropped records carrying a non-positive price.

frequency = '1m'#

The bar size of the raw tier and of the panel.

keep_qu_cond = None#

The server kept only these qu_cond quote conditions; None kept every condition.

market = 'us_equity'#

Always US equity for this vendor.

permnos = None#

Restrict the panel to these PERMNOs, as digit strings; as for NbboDatasetConfig.permnos.

reference_dir#

Directory of the CRSP reference tables the conversion reads its symbology from, as for NbboDatasetConfig.reference_dir.

session_end = '16:00'#

End of the session window the bars were cut on, US/Eastern HH:MM.

session_start = '09:30'#

Start of the session window the bars were cut on, US/Eastern HH:MM.

vendor = 'wrds'#

Always WRDS for this dataset.