quantlab.config.stock_kline_config#
- quantlab.config.stock_kline_config(start_date=None, end_date=None, symbols=None, kwargs=None, market='us_equity', frequency='1d', subdir='nasdaq_data', store_name='stock.zarr', vendor='tiingo')[source]#
Build the
DatasetConfigfor daily US-equity bars.Raw parquet is read from
downloads/{market}/{frequency}/{subdir}/{vendor}and the panel is stored atdata/{market}/{frequency}/{store_name}.subdirandstore_namelet a second roster (for example a full-market backfill) live beside the NASDAQ-only one instead of overwriting it. The raw path ends at the vendor segment on purpose:StockDatasetchecks that the directory basename equalsvendorbefore scanning, which rules out an accidental scan one level up that would merge two vendors’ shards.- Parameters:
- start_datestr | None, default None
First date to load, ISO format;
Nonemeans unbounded.- end_datestr | None, default None
Last date to load, inclusive;
Nonemeans unbounded.- symbolstuple[str, …] | None, default None
Symbols to keep;
Noneleaves the selection to the dataset.- kwargsdict | None, default None
Extra dataset options.
- marketMarket, default “us_equity”
Market label used in the storage paths.
- frequencyFrequency, default “1d”
Bar frequency used in the storage paths.
- subdirstr, default “nasdaq_data”
Raw-data subdirectory beneath the market/frequency root.
- store_namestr, default “stock.zarr”
Zarr store filename.
- vendorVendor, default “tiingo”
Vendor whose shards the raw directory holds, also recorded on the config. Defaults to
"tiingo", which is what existing callers have on disk.
Examples
With the storage root set to
/mnt/quant:>>> cfg = stock_kline_config(start_date="2020-01-01", symbols=("AAPL",)) >>> cfg.raw_data_dir_path '/mnt/quant/downloads/us_equity/1d/nasdaq_data/tiingo' >>> cfg.zarr_file_path '/mnt/quant/data/us_equity/1d/stock.zarr' >>> stock_kline_config(subdir="us_all", store_name="us_all.zarr").zarr_file_path '/mnt/quant/data/us_equity/1d/us_all.zarr'