mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-30 14:02:06 +00:00
* Update generate_terminal_markdown.py * updates * update workflows * Automated Change * tests * tests * Automated Change * Update test_generate_docs.py * Automated Change * updates * Automated Change * Update gen-docs.yml * Update test.yml * Automated Change * Update test.yml * Automated Change * Update generate_sdk_markdown.py * Automated Change * test * Automated Change * testtt23 * Automated Change * Update generate_sdk_markdown.py * Automated Change * Automated Change * added empting reference folders before autogen docs * updates * Automated Change * update tests gitactions * Automated Change * up * Automated Change * Automated Change * update pytest * Automated Change * tests * Automated Change * examples update * Automated Change * Update generate_sdk_markdown.py * Automated Change * Update test.yml * Update generate_sdk_markdown.py * strip * Automated Change * Workflow : check test update * Automated Change * Automated Change * Automated Change * Update test.yml * Automated Change * Update test.yml * Automated Change * Automated Change * up * Automated Change * Update generate_sdk_markdown.py * Automated Change * update workflows * fix guides * testing * Update gh-pages.yml * Update gh-pages.yml Co-authored-by: tehcoderer <tehcoderer@users.noreply.github.com> Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com> Co-authored-by: Chavithra PARANA <chavithra@gmail.com> Co-authored-by: Chavithra <Chavithra@users.noreply.github.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: jose-donato <jose-donato@users.noreply.github.com>
3.2 KiB
Vendored
3.2 KiB
Vendored
title, description
| title | description |
|---|---|
| index | OpenBB SDK Function |
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
index
Get data on selected indices over time [Source: Yahoo Finance]
Source Code: [link]
openbb.economy.index(indices: list, interval: str = "1d", start_date: int = None, end_date: int = None, column: str = "Adj Close", returns: bool = False)
Parameters
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
| indices | list | A list of indices to get data. Available indices can be accessed through economy.available_indices(). | None | False |
| interval | str | Valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo Intraday data cannot extend last 60 days |
1d | True |
| start_date | str | The starting date, format "YEAR-MONTH-DAY", i.e. 2010-12-31. | None | True |
| end_date | str | The end date, format "YEAR-MONTH-DAY", i.e. 2020-06-05. | None | True |
| column | str | Which column to load in, by default "Adjusted Close". | Adj Close | True |
| returns | bool | Flag to show cumulative returns on index | False | True |
Returns
| Type | Description |
|---|---|
| pd.Dataframe | Dataframe with historical data on selected indices. |
Examples
from openbb_terminal.sdk import openbb
openbb.economy.available_indices()
openbb.economy.index(["^GSPC", "sp400"])
Load (and show) the selected indices over time [Source: Yahoo Finance]
Source Code: [link]
openbb.economy.index_chart(indices: list, interval: str = "1d", start_date: int = None, end_date: int = None, column: str = "Adj Close", returns: bool = False, raw: bool = False, external_axes: Optional[List[axes]] = None, export: str = "")
Parameters
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
| indices | list | A list of indices you wish to load (and plot). Available indices can be accessed through economy.available_indices(). |
None | False |
| interval | str | Valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo Intraday data cannot extend last 60 days |
1d | True |
| start_date | str | The starting date, format "YEAR-MONTH-DAY", i.e. 2010-12-31. | None | True |
| end_date | str | The end date, format "YEAR-MONTH-DAY", i.e. 2020-06-05. | None | True |
| column | str | Which column to load in, by default this is the Adjusted Close. | Adj Close | True |
| returns | bool | Flag to show cumulative returns on index | False | True |
| raw | bool | Whether to display the raw output. | False | True |
| external_axes | Optional[List[plt.axes]] | External axes to plot on | None | True |
| export | str | Export data to csv,json,xlsx or png,jpg,pdf,svg file | True |
Returns
| Type | Description |
|---|---|
| Plots the Series. |