Skip to content

fetch_instruments


function backtide.data.fetch_instruments(symbols, instrument_type)

Get instruments given their symbols.

Parameters

symbols : str | Instrument | list[str | Instrument]

Symbols for which to get the instruments. The symbols should be of the canonical form expected by backtide.

instrument_type : str | InstrumentType
For which instrument type to get the instruments.

Returns

list[Instrument]

Instruments corresponding to the provided symbols.


See Also

download_bars

Download OHLCV data for the instruments described in a list of profiles.

list_instruments

List available instruments for a given instrument type.

resolve_profiles

Resolve the instrument profiles needed to download a set of symbols.


Example

>>> from backtide.data import fetch_instruments

>>> print(fetch_instruments(["AAPL", "MSFT"], "stocks"))

[Instrument(symbol="AAPL", name="Apple Inc.", base=None, quote="USD", instrument_type="stocks", exchange="XNAS", provider=Yahoo), Instrument(symbol="MSFT", name="Microsoft Corporation", base=None, quote="USD", instrument_type="stocks", exchange="XNAS", provider=Yahoo)]