diff options
author | Danglewood <85772166+deeleeramone@users.noreply.github.com> | 2024-02-13 09:48:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-13 12:48:52 -0500 |
commit | 2516cfbc72d23a7656715314ea94cc34d4c994ee (patch) | |
tree | 561ad644d767f0c5ca729ce0262160d71bf01302 | |
parent | 6648f51ab5c5cc4158bf4a18cb5a2f4a3dc24db5 (diff) |
Update USD Liquidity Example Notebook for V4 (#5902)
* Update USD Liquidity Example Notebook for V4
* delete some v3 text in the copperToGold
* Update README.md
* findSymbols preview image
* Google Colab preview image
* financialStatements preview
* content tsx file
* ### title
* convert tsx to json
* indent size
* double quote keys.json
* trailing commas
* Update content.json
* patch
---------
Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
-rw-r--r-- | examples/README.md | 11 | ||||
-rw-r--r-- | examples/content.json | 44 | ||||
-rw-r--r-- | examples/copperToGoldRatio.ipynb | 640 | ||||
-rw-r--r-- | examples/financialStatements.webp | bin | 0 -> 12770 bytes | |||
-rw-r--r-- | examples/findSymbols.webp | bin | 0 -> 80348 bytes | |||
-rw-r--r-- | examples/googleColab.webp | bin | 0 -> 6108 bytes | |||
-rw-r--r-- | examples/usdLiquidityIndex.ipynb | 10206 | ||||
-rw-r--r-- | openbb_terminal/cryptocurrency/due_diligence/dd_controller.py | 44 | ||||
-rw-r--r-- | openbb_terminal/cryptocurrency/due_diligence/tokenterminal_model.py | 4 |
9 files changed, 10498 insertions, 451 deletions
diff --git a/examples/README.md b/examples/README.md index 484cf64f42c..8a496fabdd5 100644 --- a/examples/README.md +++ b/examples/README.md @@ -56,3 +56,14 @@ This notebook shows you how you can use OpenbB Platform as functions in an LLM b - Convert all OpenBB Platform functions to LLM tools - Build a basic Langchain agent that can utilize function calling - Run the agent + +### usdLiquidityIndex + +This notebook demonstrates how to query the Federal Reserve Economic Database and recreate the USD Liquidity Index. + +- Search FRED for series IDs. +- Load multiple series as a single call. +- Unpacking the data response from the FRED query. +- Perform arithmetic operations on a DataFrame. +- Normalization methods for a series or DataFrame. +- Simple processes for creating charts. diff --git a/examples/content.json b/examples/content.json new file mode 100644 index 00000000000..7c5d748bd1e --- /dev/null +++ b/examples/content.json @@ -0,0 +1,44 @@ +[ + { + "title": "Install in Google Colab", + "url": "https://github.com/OpenBB-finance/OpenBBTerminal/blob/develop/examples/googleColab.ipynb", + "img":"https://raw.githubusercontent.com/OpenBB-finance/OpenBBTerminal/develop/examples/googleColab.webp", + "description": + "Install the OpenBB Platform in Google Colab and get started pulling data and creating visualizations." + }, + { + "title": "Find Symbols", + "url": "https://github.com/OpenBB-finance/OpenBBTerminal/blob/develop/examples/findSymbols.ipynb", + "img": "https://raw.githubusercontent.com/OpenBB-finance/OpenBBTerminal/develop/examples/findSymbols.webp", + "description": + "An introduction to discovering, finding, screening, and searching symbols using different sources." + }, + { + "title": "Load Historical Price Data", + "url": "https://github.com/OpenBB-finance/OpenBBTerminal/blob/develop/examples/loadHistoricalPriceData.ipynb", + "img": "https://my.openbb.co/assets/images/sdk/examples/loadHistoricalPriceData.webp", + "description": + "Loading data with different intervals and sources, ticker symbology, load data from other asset classes, load multiple tickers in one go, draw lines on plotly." + }, + { + "title": "Copper To Gold Ratio", + "url": "https://github.com/OpenBB-finance/OpenBBTerminal/blob/develop/examples/copperToGoldRatio.ipynb", + "img": "https://my.openbb.co/assets/images/sdk/examples/copperToGoldRatio.webp", + "description": + "Calculate copper to gold ratio, load front-month future prices, 10-year constant maturity vs treasury bill, basic dataframe operations, plotting on 2 y-axis." + }, + { + "title": "USD Liquidity Index", + "url": "https://github.com/OpenBB-finance/OpenBBTerminal/blob/develop/examples/usdLiquidityIndex.ipynb", + "img": "https://my.openbb.co/assets/images/sdk/examples/usdLiquidityIndex.webp", + "description": + "Query the Federal Reserve Economic Database and recreate the USD Liquidity Index, load multiple data series, basic operations on a dataframe, normalization methods, and creating custom chart." + }, + { + "title": "Financial Statements", + "url": "https://github.com/OpenBB-finance/OpenBBTerminal/blob/develop/examples/financialStatements.ipynb", + "img": "https://raw.githubusercontent.com/OpenBB-finance/OpenBBTerminal/develop/examples/financialStatements.webp", + "description": + "Get started with financial statements in the OpenBB Platform. This notebook compares the data from different providers and demonstrates how to access items within the three main financial statements - balance, cash, and income." + } +] diff --git a/examples/copperToGoldRatio.ipynb b/examples/copperToGoldRatio.ipynb index e2ccf423114..cb5dd96fecc 100644 --- a/examples/copperToGoldRatio.ipynb +++ b/examples/copperToGoldRatio.ipynb @@ -14,7 +14,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -35,7 +35,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -118,7 +118,7 @@ "2000-09-04 273.299988 0.912" ] }, - "execution_count": 63, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -137,7 +137,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -174,16 +174,16 @@ " </thead>\n", " <tbody>\n", " <tr>\n", - " <th>2023-11-20</th>\n", - " <td>2002.199951</td>\n", - " <td>3.7965</td>\n", - " <td>0.001896</td>\n", + " <th>2023-12-04</th>\n", + " <td>1998.300049</td>\n", + " <td>3.820</td>\n", + " <td>0.001912</td>\n", " </tr>\n", " <tr>\n", - " <th>2023-11-27</th>\n", - " <td>2011.800049</td>\n", - " <td>3.7625</td>\n", - " <td>0.001870</td>\n", + " <th>2023-12-11</th>\n", + " <td>2021.099976</td>\n", + " <td>3.885</td>\n", + " <td>0.001922</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", @@ -192,11 +192,11 @@ "text/plain": [ " Gold Copper Copper/Gold Ratio\n", "date \n", - "2023-11-20 2002.199951 3.7965 0.001896\n", - "2023-11-27 2011.800049 3.7625 0.001870" + "2023-12-04 1998.300049 3.820 0.001912\n", + "2023-12-11 2021.099976 3.885 0.001922" ] }, - "execution_count": 64, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -217,7 +217,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -254,16 +254,16 @@ " </thead>\n", " <tbody>\n", " <tr>\n", - " <th>2023-11-20</th>\n", - " <td>2002.199951</td>\n", - " <td>3.7965</td>\n", - " <td>1.896164</td>\n", + " <th>2023-12-04</th>\n", + " <td>1998.300049</td>\n", + " <td>3.820</td>\n", + " <td>1.911625</td>\n", " </tr>\n", " <tr>\n", - " <th>2023-11-27</th>\n", - " <td>2011.800049</td>\n", - " <td>3.7625</td>\n", - " <td>1.870216</td>\n", + " <th>2023-12-11</th>\n", + " <td>2021.099976</td>\n", + " <td>3.885</td>\n", + " <td>1.922221</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", @@ -272,11 +272,11 @@ "text/plain": [ " Gold Copper Copper/Gold Ratio\n", "date \n", - "2023-11-20 2002.199951 3.7965 1.896164\n", - "2023-11-27 2011.800049 3.7625 1.870216" + "2023-12-04 1998.300049 3.820 1.911625\n", + "2023-12-11 2021.099976 3.885 1.922221" ] }, - "execution_count": 65, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -297,7 +297,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -365,7 +365,7 @@ "2000-09-04 5.68 " ] }, - "execution_count": 67, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -394,7 +394,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -1621,7 +1621,9 @@ "2023-11-06", "2023-11-13", "2023-11-20", - "2023-11-27" + "2023-11-27", + "2023-12-04", + "2023-12-11" ], "y": [ 3.2093862764241465, @@ -2837,7 +2839,9 @@ 1.8542377903946718, 1.8861021388593557, 1.8961642494062623, - 1.8702157055197284 + 1.8874939255873286, + 1.9116248010317485, + 1.9222205914563706 ] }, { @@ -4057,7 +4061,9 @@ "2023-11-06", "2023-11-13", "2023-11-20", - "2023-11-27" + "2023-11-27", + "2023-12-04", + "2023-12-11" ], "y": [ 5.78, @@ -5273,6 +5279,8 @@ 4.67, 4.63, 4.42, + 4.39, + null, null ] } @@ -5289,14 +5297,14 @@ "bar": [ { "error_x": { - "color": "#f2f5fa" + "color": "#2a3f5f" }, "error_y": { - "color": "#f2f5fa" + "color": "#2a3f5f" }, "marker": { "line": { - "color": "rgb(17,17,17)", + "color": "#E5ECF6", "width": 0.5 }, "pattern": { @@ -5312,7 +5320,7 @@ { "marker": { "line": { - "color": "rgb(17,17,17)", + "color": "#E5ECF6", "width": 0.5 }, "pattern": { @@ -5324,38 +5332,21 @@ "type": "barpolar" } ], - "candlestick": [ - { - "decreasing": { - "fillcolor": "#e4003a", - "line": { - "color": "#e4003a" - } - }, - "increasing": { - "fillcolor": "#00ACFF", - "line": { - "color": "#00ACFF" - } - }, - "type": "candlestick" - } - ], "carpet": [ { "aaxis": { - "endlinecolor": "#A2B1C6", - "gridcolor": "#506784", - "linecolor": "#506784", - "minorgridcolor": "#506784", - "startlinecolor": "#A2B1C6" + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" }, "baxis": { - "endlinecolor": "#A2B1C6", - "gridcolor": "#506784", - "linecolor": "#506784", - "minorgridcolor": "#506784", - "startlinecolor": "#A2B1C6" + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" }, "type": "carpet" } @@ -5673,10 +5664,10 @@ ], "scatter": [ { - "marker": { - "line": { - "color": "#283442" - } + "fillpattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 }, "type": "scatter" } @@ -5723,8 +5714,9 @@ "scattergl": [ { "marker": { - "line": { - "color": "#283442" + "colorbar": { + "outlinewidth": 0, + "ticks": "" } }, "type": "scattergl" @@ -5829,18 +5821,18 @@ { "cells": { "fill": { - "color": "#506784" + "color": "#EBF0F8" }, "line": { - "color": "rgb(17,17,17)" + "color": "white" } }, "header": { "fill": { - "color": "#2a3f5f" + "color": "#C8D4E3" }, "line": { - "color": "rgb(17,17,17)" + "color": "white" } }, "type": "table" @@ -5849,10 +5841,9 @@ }, "layout": { "annotationdefaults": { - "arrowcolor": "#f2f5fa", + "arrowcolor": "#2a3f5f", "arrowhead": 0, - "arrowwidth": 1, - "showarrow": false + "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { @@ -5994,194 +5985,125 @@ ] }, "colorway": [ - "#ffed00", - "#ef7d00", - "#e4003a", - "#c13246", - "#822661", - "#48277c", - "#005ca9", - "#00aaff", - "#9b30d9", - "#af005f", - "#5f00af", - "#af87ff" + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" ], - "dragmode": "pan", "font": { - "color": "#f2f5fa", - "family": "Fira Code", - "size": 18 + "color": "#2a3f5f" }, "geo": { - "bgcolor": "rgb(17,17,17)", - "lakecolor": "rgb(17,17,17)", - "landcolor": "rgb(17,17,17)", + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", "showlakes": true, "showland": true, - "subunitcolor": "#506784" + "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, - "hovermode": "x", - "legend": { - "bgcolor": "rgba(0, 0, 0, 0.5)", - "font": { - "size": 15 - }, - "x": 0.01, - "xanchor": "left", - "y": 0.99, - "yanchor": "top" - }, - "legend2": { - "bgcolor": "rgba(0, 0, 0, 0.5)", - "font": { - "size": 15 - } - }, - "legend3": { - "bgcolor": "rgba(0, 0, 0, 0.5)", - "font": { - "size": 15 - } - }, - "legend4": { - "bgcolor": "rgba(0, 0, 0, 0.5)", - "font": { - "size": 15 - } - }, - "legend5": { - "bgcolor": "rgba(0, 0, 0, 0.5)", - "font": { - "size": 15 - } - }, + "hovermode": "closest", "mapbox": { - "style": "dark" + "style": "light" }, - "paper_bgcolor": "#000000", - "plot_bgcolor": "#000000", + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { - "gridcolor": "#506784", - "linecolor": "#506784", + "gridcolor": "white", + "linecolor": "white", "ticks": "" }, - "bgcolor": "rgb(17,17,17)", + "bgcolor": "#E5ECF6", "radialaxis": { - "gridcolor": "#506784", - "linecolor": "#506784", + "gridcolor": "white", + "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { - "backgroundcolor": "rgb(17,17,17)", - "gridcolor": "#506784", + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", "gridwidth": 2, - "linecolor": "#506784", + "linecolor": "white", "showbackground": true, "ticks": "", - "zerolinecolor": "#C8D4E3" + "zerolinecolor": "white" }, "yaxis": { - "backgroundcolor": "rgb(17,17,17)", - "gridcolor": "#506784", + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", "gridwidth": 2, - "linecolor": "#506784", + "linecolor": "white", "showbackground": true, "ticks": "", - "zerolinecolor": "#C8D4E3" + "zerolinecolor": "white" }, "zaxis": { - "backgroundcolor": "rgb(17,17,17)", - "gridcolor": "#506784", + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", "gridwidth": 2, - "linecolor": "#506784", + "linecolor": "white", "showbackground": true, "ticks": "", - "zerolinecolor": "#C8D4E3" + "zerolinecolor": "white" } }, "shapedefaults": { "line": { - "color": "#f2f5fa" + "color": "#2a3f5f" } }, - "sliderdefaults": { - "bgcolor": "#C8D4E3", - "bordercolor": "rgb(17,17,17)", - "borderwidth": 1, - "tickwidth": 0 - }, "ternary": { "aaxis": { - "gridcolor": "#506784", - "linecolor": "#506784", + "gridcolor": "white", + "linecolor": "white", "ticks": "" }, "baxis": { - "gridcolor": "#506784", - "linecolor": "#506784", + "gridcolor": "white", + "linecolor": "white", "ticks": "" }, - "bgcolor": "rgb(17,17,17)", + "bgcolor": "#E5ECF6", "caxis": { - "gridcolor": "#506784", - "linecolor": "#506784", + "gridcolor": "white", + "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, - "updatemenudefaults": { - "bgcolor": "#506784", - "borderwidth": 0 - }, "xaxis": { "automargin": true, - "autorange": true, - "gridcolor": "#283442", - "linecolor": "#F5EFF3", - "mirror": true, - "rangeslider": { - "visible": false - }, - "showgrid": true, - "showline": true, - "tick0": 1, - "tickfont": { - "size": 14 - }, - "ticks": "outside", + "gridcolor": "white", + "linecolor": "white", + "ticks": "", "title": { - "standoff": 20 + "standoff": 15 }, - "zeroline": false, - "zerolinecolor": "#283442", + "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { - "anchor": "x", "automargin": true, - "fixedrange": false, - "gridcolor": "#283442", - "linecolor": "#F5EFF3", - "mirror": true, - "showgrid": true, - "showline": true, - "side": "right", - "tick0": 0.5, - "ticks": "outside", + "gridcolor": "white", + "linecolor": "white", + "ticks": "", "title": { - "standoff": 20 + "standoff": 15 }, - "zeroline": false, - "zerolinecolor": "#283442", + "zerolinecolor": "white", "zerolinewidth": 2 } } @@ -6245,7 +6167,7 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -6286,20 +6208,20 @@ " </thead>\n", " <tbody>\n", " <tr>\n", - " <th>2023-11-20</th>\n", - " <td>2002.199951</td>\n", - " <td>3.7965</td>\n", - " <td>1.896164</td>\n", - " <td>4.42</td>\n", - " <td>0.130023</td>\n", + " <th>2023-12-04</th>\n", + " <td>1998.300049</td>\n", + " <td>3.820</td>\n", + " <td>1.911625</td>\n", + " <td>NaN</td>\n", + " <td>0.131083</td>\n", " </tr>\n", " <tr>\n", - " <th>2023-11-27</th>\n", - " <td>2011.800049</td>\n", - " <td>3.7625</td>\n", - " <td>1.870216</td>\n", + " <th>2023-12-11</th>\n", + " <td>2021.099976</td>\n", + " <td>3.885</td>\n", + " <td>1.922221</td>\n", " <td>NaN</td>\n", - " <td>0.128243</td>\n", + " <td>0.131809</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", @@ -6308,21 +6230,21 @@ "text/plain": [ " Gold Copper Copper/Gold Ratio \\\n", "date \n", - "2023-11-20 2002.199951 3.7965 1.896164 \n", - "2023-11-27 2011.800049 3.7625 1.870216 \n", + "2023-12-04 1998.300049 3.820 1.911625 \n", + "2023-12-11 2021.099976 3.885 1.922221 \n", "\n", " US 10-Year Constant Maturity \\\n", "date \n", - "2023-11-20 4.42 \n", - "2023-11-27 NaN \n", + "2023-12-04 NaN \n", + "2023-12-11 NaN \n", "\n", " Copper/Gold Ratio per Ounce (x1000) % \n", "date \n", - "2023-11-20 0.130023 \n", - "2023-11-27 0.128243 " + "2023-12-04 0.131083 \n", + "2023-12-11 0.131809 " ] }, - "execution_count": 78, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -6336,27 +6258,15 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "Each y-axis requires its own DataFrame, so let's make one for each next." + "Now let's draw it!" ] }, { "cell_type": "code", - "execution_count": 23, - "metadata": {}, - "outputs": [], - "source": [ - "y1 = pd.DataFrame(data[\"Copper/Gold Ratio per Ounce (x1000) %\"])\n", - "y2 = pd.DataFrame(data[\"US 10-Year Constant Maturity\"])\n", - "fig = show_plot(y1, y2, external_axes = True)" - ] - }, - { - "cell_type": "code", - "execution_count": 85, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -7583,7 +7493,9 @@ "2023-11-06", "2023-11-13", "2023-11-20", - "2023-11-27" + "2023-11-27", + "2023-12-04", + "2023-12-11" ], "y": [ 3.2093862764241465, @@ -8799,7 +8711,9 @@ 1.8542377903946718, 1.8861021388593557, 1.8961642494062623, - 1.8702157055197284 + 1.8874939255873286, + 1.9116248010317485, + 1.9222205914563706 ], "yaxis": "y" }, @@ -10020,7 +9934,9 @@ "2023-11-06", "2023-11-13", "2023-11-20", - "2023-11-27" + "2023-11-27", + "2023-12-04", + "2023-12-11" ], "y": [ 5.78, @@ -11236,6 +11152,8 @@ 4.67, 4.63, 4.42, + 4.39, + null, null ], "yaxis": "y2" @@ -11256,14 +11174,14 @@ "bar": [ { "error_x": { - "color": "#f2f5fa" + "color": "#2a3f5f" }, "error_y": { - "color": "#f2f5fa" + "color": "#2a3f5f" }, "marker": { "line": { - "color": "rgb(17,17,17)", + "color": "#E5ECF6", "width": 0.5 }, "pattern": { @@ -11279,7 +11197,7 @@ { "marker": { "line": { - "color": "rgb(17,17,17)", + "color": "#E5ECF6", "width": 0.5 }, "pattern": { @@ -11291,38 +11209,21 @@ "type": "barpolar" } ], - "candlestick": [ - { - "decreasing": { - "fillcolor": "#e4003a", - "line": { - |