download_bars
function backtide.data.download_bars(profiles, start=None, end=None, verbose=True)
Download OHLCV data for the instruments described in a list of profiles.
Concurrently downloads all instruments and legs, skipping data already stored in the database.
| Parameters |
profiles : list[InstrumentProfile]
Resolved instrument profiles (run
start : int | None, default=Noneresolve_profiles first).
Optional start of the download window (Unix timestamp, inclusive). When
given, per-instrument ranges are clamped so that no data before this timestamp
is requested. If
end : int | None, default=NoneNone, it uses the provider's earliest available date.
Optional end of the download window (Unix timestamp, exclusive). When
given, per-instrument ranges are clamped so that no data after this timestamp
is requested. If
verbose : bool, default=TrueNone, it uses the provider's latest available date.
Whether to display a progress bar while downloading.
|
| Returns |
Summary of the download: succeeded/failed counts and per-task warnings.
|
See Also
Return stored OHLCV bars as a dataframe.
Get instruments given their symbols.
Resolve the instrument profiles needed to download a set of symbols.
Example
>>> from backtide.data import resolve_profiles, download_bars
>>> profiles = resolve_profiles(["AAPL", "MSFT"], "stocks", "1d")
>>> result = download_bars(profiles)
>>> print(result)
DownloadResult(n_succeeded=2, n_failed=0, warnings=[])