quantlab.dataset.config.NbboDatasetConfig#
- class quantlab.dataset.config.NbboDatasetConfig(*, 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='tick', vendor='wrds', reference_dir, permnos=None, bar_interval='1m', session_start='09:30', session_end='16:00', drop_crossed=True, drop_locked=False, drop_nonpositive_price=True, keep_qu_cond=None)[source]#
Bases:
DatasetConfigConfig of the intraday bar panel built from WRDS TAQ NBBO quotes.
frequencystays"tick"(the raw tier holds one row per NBBO record); the size of the bars the panel is resampled to is the separatebar_interval. The fourdrop_*andkeep_*fields are the resampler’s record filter and are config fields, notkwargs, so a rebuild fromconfig.jsonreproduces the panel exactly.The panel’s
symbolaxis is the integer PERMNO, the same axis as the CRSP panels, although the raw TAQ files are keyed by ticker. The conversion maps each raw(date, ticker)to its PERMNO through the CRSP symbology inreference_dir, so the inherited ticker-sidesymbolsfield is refused by the dataset’s config setter; usepermnosinstead. Seedocs/user-guide/wrds.md.Examples
>>> cfg = NbboDatasetConfig( ... zarr_file_path="/data/us_equity/tick/nbbo_5m.zarr", ... raw_data_dir_path="/data/downloads/us_equity/tick/wrds", ... reference_dir="/data/downloads/_reference", ... bar_interval="5m", ... start_date="2024-01-02", ... end_date="2024-01-31", ... permnos=("14593",), ... ) >>> cfg.frequency, cfg.bar_interval, cfg.drop_crossed ('tick', '5m', True)
- bar_interval = '1m'#
Bar size the tick records are resampled to.
- drop_crossed = True#
Drop records whose bid exceeds the ask (both sides present).
- drop_locked = False#
Drop records whose bid equals the ask.
- drop_nonpositive_price = True#
Drop records carrying a non-positive price.
- frequency = 'tick'#
Always tick: the raw tier is one row per NBBO record.
- keep_qu_cond = None#
Keep only these
qu_condquote conditions.Nonekeeps every condition.
- market = 'us_equity'#
Always US equity for this vendor.
- permnos = None#
Restrict the panel to these PERMNOs, as digit strings.
Nonemeans every PERMNO the raw tier’s tickers resolve to; an empty tuple is refused at config assignment because it could mean either “none” or “all”. A listed PERMNO is on the axis even when the raw tier has no record for it, as an all-NaN column.
- reference_dir#
Directory of the CRSP reference tables (
stksecurityinfohistand friends) the conversion reads its symbology from: the mapping from a ticker on a date to the PERMNO that traded under it. The same directoryscripts/wrds/index.pyfills for the CRSP panels.
- session_end = '16:00'#
End of the session window, US/Eastern wall clock
HH:MM.
- session_start = '09:30'#
Start of the session window, US/Eastern wall clock
HH:MM.
- vendor = 'wrds'#
Always WRDS for this dataset.