historical
ETF Historical Market Price.
Example
from openbb import obb
obb.etf.historical(symbol="SPY")
obb.etf.historical("SPY", provider="yfinance")
#### This function accepts multiple tickers. ####
obb.etf.historical("SPY,IWM,QQQ,DJIA", provider="yfinance")
Parameters
- standard
- yfinance
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
| symbol | str | Symbol to get data for. (ETF) | False | |
| start_date | Union[str, date] | Start date of the data, in YYYY-MM-DD format. | None | True |
| end_date | Union[str, date] | End date of the data, in YYYY-MM-DD format. | None | True |
| provider | Literal['yfinance'] | The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'yfinance' if there is no default. | yfinance | True |
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
| symbol | str | Symbol to get data for. (ETF) | False | |
| start_date | Union[str, date] | Start date of the data, in YYYY-MM-DD format. | None | True |
| end_date | Union[str, date] | End date of the data, in YYYY-MM-DD format. | None | True |
| provider | Literal['yfinance'] | The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'yfinance' if there is no default. | yfinance | True |
Returns
OBBject
results : List[EtfHistorical]
Serializable results.
provider : Optional[Literal['yfinance']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra : Dict[str, Any]
Extra info.
Data
- standard
- yfinance
| Name | Type | Description |
|---|---|---|
| date | Union[date, datetime] | The date of the data. |
| open | float | The open price. |
| high | float | The high price. |
| low | float | The low price. |
| close | float | The close price. |
| volume | int | The trading volume. |
| Name | Type | Description |
|---|---|---|
| date | Union[date, datetime] | The date of the data. |
| open | float | The open price. |
| high | float | The high price. |
| low | float | The low price. |
| close | float | The close price. |
| volume | int | The trading volume. |
| adj_close | float | The adjusted closing price of the ETF. |