list_instruments
function backtide.data.list_instruments(instrument_type, exchange=None, limit=100, verbose=True)
List available instruments for a given instrument type.
When exchanges is provided, the limit is distributed evenly across the
specified exchanges.
| Parameters |
instrument_type : str | InstrumentType
For which instrument type to list the instruments.
exchange : str | Exchange | list[str | Exchange] | None, default=None
Optional exchange filter. If
limit : int, default=100None, a default list of major exchanges is
used. If specified, only query those exchanges and distribute limit evenly
across them. This parameter is ignored for single-exchange providers.
Maximum number of instruments to return. The actual number may be smaller,
but not larger.
verbose : bool, default=True
Whether to display a progress spinner in the terminal.
|
| Returns |
list[Instrument]
Instruments for the given instrument type.
|
See Also
Download OHLCV data for the instruments described in a list of profiles.
Get instruments given their symbols.
Resolve the instrument profiles needed to download a set of symbols.
Example
>>> from backtide.data import list_instruments
>>> print(list_instruments("crypto", limit=5))
[Instrument(symbol="BTC-USD", name="Bitcoin USD", base="BTC", quote="USD", instrument_type="crypto", exchange="CCC", provider=Yahoo), Instrument(symbol="BTC-EUR", name="Bitcoin EUR", base="BTC", quote="EUR", instrument_type="crypto", exchange="CCC", provider=Yahoo), Instrument(symbol="BTC-GBP", name="Bitcoin GBP", base="BTC", quote="GBP", instrument_type="crypto", exchange="CCC", provider=Yahoo)]