fetch_price_history
Fetches historical price data for the specified asset and period using the API. The first row is the earliest entry and the last row is the latest entry.
Syntax
Fields
Description
symbol(str)
The stock/crypto to get data for. Note options are not supported.
interval(Interval)
The interval of requested historical data.
start(Union[str, dt.datetime])
The starting date of the period, inclusive. Defaults to None
end(Union[str, dt.datetime])
The ending date of the period, inclusive. Defaults to None
def fetch_price_history(
self,
symbol: str,
interval: Interval,
start: Union[str, dt.datetime] = None,
end: Union[str, dt.datetime] = None,
) -> pd.DataFrame:
Returns
Returns a pandas dataframe in the same format as self.step()
.
Raises
- A
NotImplementedError
is raised if the method is not supported.