historical
Historical futures prices.
Examples
from openbb import obb
obb.derivatives.futures.historical(symbol='ES', provider='yfinance')
# Enter multiple symbols.
obb.derivatives.futures.historical(symbol='ES,NQ', provider='yfinance')
# Enter expiration dates as "YYYY-MM".
obb.derivatives.futures.historical(symbol='ES', provider='yfinance', expiration='2025-12')
Parameters
- standard
- yfinance
Name | Type | Description | Default | Optional |
---|---|---|---|---|
symbol | Union[str, List[str]] | Symbol to get data for. Multiple items allowed for provider(s): yfinance. | False | |
start_date | Union[date, str] | Start date of the data, in YYYY-MM-DD format. | None | True |
end_date | Union[date, str] | End date of the data, in YYYY-MM-DD format. | None | True |
expiration | str | Future expiry date with format YYYY-MM | None | True |
Name | Type | Description | Default | Optional |
---|---|---|---|---|
symbol | Union[str, List[str]] | Symbol to get data for. Multiple items allowed for provider(s): yfinance. | False | |
start_date | Union[date, str] | Start date of the data, in YYYY-MM-DD format. | None | True |
end_date | Union[date, str] | End date of the data, in YYYY-MM-DD format. | None | True |
expiration | str | Future expiry date with format YYYY-MM | None | True |
interval | Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1W', '1M', '1Q'] | Time interval of the data to return. | 1d | True |
Returns
OBBject
results : List[FuturesHistorical]
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[datetime, str] | 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 | float | The trading volume. |
Name | Type | Description |
---|---|---|
date | Union[datetime, str] | 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 | float | The trading volume. |