quantlab.acquisition.config.stock_acquisition_config#

quantlab.acquisition.config.stock_acquisition_config(symbols, start_date=None, end_date=None, kwargs=None, market='us_equity', frequency='1d', subdir='nasdaq_data', vendor='tiingo')[source]#

Build the AcquisitionConfig for a symbol-batched download.

Tiingo and Alpaca use it for their US-equity bars, and FRED for its rate series (vendor="fred", subdir="macro"), which file under the same downloads/us_equity/1d/ tree. Raw shards are written beneath {subdir}/{vendor} and watermarks beneath {subdir}/_watermarks/{vendor}, both under downloads/{market}/{frequency}/. The watermark directory is a sibling of the raw root rather than inside it because a polars directory scan reads every file beneath the root it is given, and a .json sidecar in the raw tree would break scan_parquet. A separate subdir per roster keeps two backfills independently resumable.

Parameters:
symbolstuple[str, …]

Symbols to download.

start_datestr | None, default None

First date to request; None leaves it to the vendor client.

end_datestr | None, default None

Last date to request; None leaves it to the vendor client.

kwargsdict | None, default None

Extra acquisition options (for example max_workers).

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.

vendorVendor, default “tiingo”

Vendor to fetch from. Defaults to "tiingo", which is what existing callers have on disk.

Examples

With the storage root set to /mnt/quant (quantlab.config.set_data_root):

>>> cfg = stock_acquisition_config(
...     symbols=("AAPL", "MSFT"), start_date="2020-01-01"
... )
>>> cfg.raw_data_dir_path
'/mnt/quant/downloads/us_equity/1d/nasdaq_data/tiingo'
>>> cfg.watermark_path
'/mnt/quant/downloads/us_equity/1d/nasdaq_data/_watermarks/tiingo'