summaryrefslogtreecommitdiffstats
path: root/appinfo
AgeCommit message (Expand)Author
2013-07-23log unimportant errors on debug levelBernhard Posselt
2013-07-19fix create api routeBernhard Posselt
2013-07-19also update version fileBernhard Posselt
2013-07-19version bump1.201Bernhard Posselt
2013-06-12adjust routes for new apiBernhard Posselt
2013-06-11implement starring and marking as read for multiple itemsBernhard Posselt
2013-06-11added method for marking all readBernhard Posselt
2013-06-06bump version to unstableBernhard Posselt
2013-06-05Merge pull request #206 from xemle/restful-urls-for-backendBernhard Posselt
2013-06-01version bump1.001Bernhard Posselt
2013-05-27Issue #166 Improve RESTful urls for web backendXemle
2013-05-25version bumpBernhard Posselt
2013-05-24fixed a bug when deleting foldersBernhard Posselt
2013-05-24version bumpBernhard Posselt
2013-05-10use a deleted flag for deleted feeds to handle undoBernhard Posselt
2013-05-09only make one request for mark all read and mark folder read, fix #171, fix a...Bernhard Posselt
2013-05-06removed useless upgrade helperBernhard Posselt
2013-05-06require 5.0.6 for api fixesBernhard Posselt
2013-05-04use 99 as maximum unread count to display, permanently display delete button ...Bernhard Posselt
2013-05-04version bumpBernhard Posselt
2013-05-04fix link xss vulnerabilitiesBernhard Posselt
2013-05-04bump versionBernhard Posselt
2013-05-03also set version number in xml file to fix appstore problemsBernhard Posselt
2013-05-03also provide the app versionBernhard Posselt
2013-05-02set a lower version for owncloud to enable future proper upgradesBernhard Posselt
2013-05-02require at least owncloud 5.0.5Bernhard Posselt
2013-05-02removed useless get calls to apiBernhard Posselt
2013-05-02move external api stuff to appframeworkBernhard Posselt
2013-05-02implement all routes and function bodies for api callsBernhard Posselt
2013-05-02fix result returnBernhard Posselt
2013-05-02implemented first feeds get all methodBernhard Posselt
2013-04-30mention requirements and backgroundjobs in the apps descriptionBernhard Posselt
2013-04-29fix version tagBernhard Posselt
2013-04-29set version 1.0Bernhard Posselt
2013-04-29prepare readme for beta releaseBernhard Posselt
2013-04-29go back to order by id, fix #138, use a newest item id to prevent marking ite...Bernhard Posselt
2013-04-22added import from google reader, fix #80Bernhard Posselt
2013-04-20error log when appframework is not enabledBernhard Posselt
2013-04-19added a way to prevent feed from being updatedBernhard Posselt
2013-04-19added javascript for uploading google reader json filesBernhard Posselt
2013-04-19added skeletons for google reader importBernhard Posselt
2013-04-15dont break if owncloud if appframework isnt enabledBernhard Posselt
2013-04-15get language from server and save it in a language object, dont use a seperat...Bernhard Posselt
2013-04-12implement mark as read for feeds and folders, fix #29Bernhard Posselt
2013-04-08add link to feed which gets opened when clicked on the subheading of an itemBernhard Posselt
2013-04-05remove admin pageBernhard Posselt
2013-04-03removed useless settingsBernhard Posselt
2013-03-30remove search plugin. YAGNIAlessandro Cosentino
2013-03-27star by guid hash and feedid to also star an item if it has been updated in t...Bernhard Posselt
2013-03-27changed timestamp datatype to integer which fixes #10Bernhard Posselt
.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
---
title: Futures
---

The functions from the OpenBB Terminal Futures menu is part of the SDK layer, and provides methods for programmatically accessing the data and charts associated with them. Get started by importing the OpenBB SDK to the Python script or Jupyter Notebook file.


## How to Use

Below is a brief description of each function within the Futures module:

|Path |Type |Description |
|:---------|:---------:|------------------------------:|
|openbb.futures.curve |Function |Futures Forward Curve Data
|openbb.futures.curve_chart |Function |Futures Forward Curve Chart
|openbb.futures.search |Function |Search Available Futures
|openbb.futures.historical |Function |Historical OHLC+V Data
|openbb.futures.historical_chart |Function |Chart Historical Price of Individual Contracts

## Examples

### Import Statements

The examples here will assume that the block below is included at the top of the file:

```python
from openbb_terminal.sdk import openbb
import pandas as pd
%matplotlib inline
```

### Search

Futures can be searched by description, exchange, or category.

```python
openbb.futures.search(description = 'Eurodollar')
```

|     | Ticker   | Description                          | Exchange   | Category   |
|----:|:---------|:-------------------------------------|:-----------|:-----------|
|  66 | GE       | Eurodollar Futures                   | CME        | currency   |
|  67 | GLB      | One-Month Eurodollar Futures         | CME        | currency   |
| 152 | SED      | SED (SOFR-Eurodollar) Spread Futures | CME        | bonds      |

The historical front-month price is captured to a DataFrame with:

### Curve

The forward curve data for a symbol is fetched with:

```python
eurodollar = openbb.futures.curve('GE')
```

|Expiration           |   Futures |
|:--------------------|----------:|
| 2022-11-01 00:00:00 |   95.3561 |
| 2022-12-01 00:00:00 |   94.9925 |
| 2023-01-01 00:00:00 |   94.985  |
| 2023-02-01 00:00:00 |   94.9    |
| 2023-03-01 00:00:00 |   94.825  |

To display a chart of the data, use `curve_chart`:

```python
openbb.futures.curve_chart(symbol = 'GE')
```

![openbb.futures.curve_chart](https://user-images.githubusercontent.com/85772166/202352342-eecf872d-8934-42e7-8b53-4e3415bc2993.png "openbb.futures.curve_chart")

### Historical

The `historical` function can fetch the historical front-month price:

```python
wti_continuous = obb.futures.historical('CL')
```

Or, while actively trading, individual contracts. The example below requests historical data for the December WTI contract from 2023 to 2030, starting at the first recorded trading day of the December 2030 contract.

```python
cl_2312 = openbb.futures.historical(symbols = ['CL'], expiry = '2023-12')
cl_2312 = cl_2312.rename(columns={'Adj Close':'2023-12'})
cl_2412 = openbb.futures.historical(symbols = ['CL'], expiry = '2024-12')
cl_2412 = cl_2412.rename(columns={'Adj Close':'2024-12'})
cl_2512 = openbb.futures.historical(symbols = ['CL'], expiry = '2025-12')
cl_2512 = cl_2512.rename(columns={'Adj Close':'2025-12'})
cl_2612 = openbb.futures.historical(symbols = ['CL'], expiry = '2026-12')
cl_2612 = cl_2612.rename(columns={'Adj Close':'2026-12'})
cl_2712 = openbb.futures.historical(symbols = ['CL'], expiry = '2027-12')
cl_2712 = cl_2712.rename(columns={'Adj Close':'2027-12'})
cl_2812 = openbb.futures.historical(symbols = ['CL'], expiry = '2028-12')
cl_2812 = cl_2812.rename(columns={'Adj Close':'2028-12'})
cl_2912 = openbb.futures.historical(symbols = ['CL'], expiry = '2029-12')
cl_2912 = cl_2912.rename(columns={'Adj Close':'2029-12'})
cl_3012 = openbb.futures.historical(symbols = ['CL'], expiry = '2030-12')
cl_3012 = cl_3012.rename(columns={'Adj Close':'2030-12'})

historical = pd.DataFrame(data = [cl_2312['2023-12'],cl_2412['2024-12'],cl_2512['2025-12'],cl_2612['2026-12'],cl_2712['2027-12'],cl_2812['2028-12'],cl_2912['2029-12'],cl_3012['2030-12']]).transpose()
historical = historical.dropna()

historical
```

| Date                |   2023-12 |   2024-12 |   2025-12 |   2026-12 |   2027-12 |   2028-12 |   2029-12 |   2030-12 |
|:--------------------|----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|
| 2020-01-24 00:00:00 |     49.61 |     50.14 |     50.7  |     51.56 |     51.63 |     51.63 |     51.63 |     51.63 |
| 2020-01-27 00:00:00 |     49.94 |     50.6  |     51.18 |     51.05 |     51.12 |     51.12 |     51.12 |     51.12 |
| 2020-01-28 00:00:00 |     50.17 |     50.78 |     51.23 |     51.55 |     51.62 |     51.62 |     51.62 |     51.62 |
| 2020-01-29 00:00:00 |     50.07 |     50.64 |     51.13 |     51.6  |     51.67 |     51.67 |     51.67 |     51.67 |
| 2020-01-30 00:00:00 |     50.27 |     50.91 |     51.44 |     51.49 |     51.56 |     51.56 |     51.56 |     51.56 |
| 2022-11-09 00:00:00 |     76.69 |     71.62 |     68.01 |     65.1  |     62.52 |     60.17 |     58.12 |     56.49 |
| 2022-11-10 00:00:00 |     77    |     71.64 |     67.89 |     64.86 |     62.26 |     59.91 |     57.86 |     56.23 |
| 2022-11-11 00:00:00 |     78.81 |     73.1  |     69.22 |     66.19 |     63.6  |     61.25 |     59.2  |     57.57 |
| 2022-11-14 00:00:00 |     77.4  |     72.35 |     68.89 |     66.15 |     63.62 |     61.25 |     59.13 |     57.5  |
| 2022-11-15 00:00:00 |     78.82 |     73.66 |     70.14 |     67.36 |     64.94 |     62.62 |     60.49 |     58.68 |