mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-12-01 13:44:16 +00:00
Fix reports after SDK changes (#3444)
* Fix sdk changes * Forex report * Crypto Report * etf report * economy report
This commit is contained in:
@@ -505,7 +505,7 @@ stocks.candle,openbb_terminal.stocks.stocks_helper.display_candle,
|
||||
crypto.load,openbb_terminal.cryptocurrency.cryptocurrency_helpers.load,
|
||||
crypto.price,openbb_terminal.cryptocurrency.pyth_model.get_price,
|
||||
crypto.find,openbb_terminal.cryptocurrency.cryptocurrency_helpers.find,
|
||||
crypto.chart,openbb_terminal.cryptocurrency.cryptocurrency_helpers.plot_chart,openbb_terminal.cryptocurrency.cryptocurrency_helpers.plot_chart
|
||||
crypto.chart,openbb_terminal.cryptocurrency.cryptocurrency_helpers.plot_chart,
|
||||
crypto.candles,openbb_terminal.cryptocurrency.cryptocurrency_helpers.plot_candles,
|
||||
etf.candle,openbb_terminal.stocks.stocks_helper.display_candle,
|
||||
forex.candle,openbb_terminal.forex.forex_helper.display_candle,
|
||||
|
||||
|
Can't render this file because it has a wrong number of fields in line 463.
|
28
openbb_terminal/reports/templates/crypto.ipynb
vendored
28
openbb_terminal/reports/templates/crypto.ipynb
vendored
@@ -327,7 +327,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n",
|
||||
"openbb.crypto.chart_chart(\n",
|
||||
"openbb.crypto.chart(\n",
|
||||
" historical_data_one_year,\n",
|
||||
" to_symbol=ticker,\n",
|
||||
" from_symbol=\"USDT\",\n",
|
||||
@@ -934,7 +934,7 @@
|
||||
"# box and whisker plot\n",
|
||||
"\n",
|
||||
"fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n",
|
||||
"openbb.qa.bw_chart(\n",
|
||||
"openbb.qa.bw(\n",
|
||||
" symbol=ticker,\n",
|
||||
" data=ticker_data,\n",
|
||||
" target=\"Close\",\n",
|
||||
@@ -991,24 +991,6 @@
|
||||
"kurtosis = f.getvalue().decode(\"utf-8\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ebdbebf5",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## PRED"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "fd5136de",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# TODO: add prediction"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ac501a32-124d-4d21-aae1-a8d147bb1071",
|
||||
@@ -1189,7 +1171,7 @@
|
||||
"metadata": {
|
||||
"celltoolbar": "Tags",
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.10.4 ('obb')",
|
||||
"display_name": "Python 3.9.6 ('obb')",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
@@ -1203,11 +1185,11 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.4"
|
||||
"version": "3.9.6"
|
||||
},
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "1a8cc6b6e60740679b24fc1ea93bdeb94d949a22102a80c99b7fd3f0d572afd6"
|
||||
"hash": "cb66ba39c97f15743fbb79e204a841ea03600987d49579cfb0ffc8e8dd934c69"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
"overview.set_index(list(overview.columns[0]), inplace=True)\n",
|
||||
"futures = openbb.economy.futures()\n",
|
||||
"futures.set_index(list(futures.columns[0]), inplace=True)\n",
|
||||
"news = openbb.common.news(\"economy\")\n",
|
||||
"news = openbb.news(\"economy\")\n",
|
||||
"news.columns = news.columns.str.title()\n",
|
||||
"news.set_index(\"Published\", inplace=True)"
|
||||
]
|
||||
|
||||
95
openbb_terminal/reports/templates/equity.ipynb
vendored
95
openbb_terminal/reports/templates/equity.ipynb
vendored
@@ -316,7 +316,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"expiry_dates = openbb.stocks.options.option_expirations(symbol)\n",
|
||||
"expiry_dates = openbb.stocks.options.expirations(symbol)\n",
|
||||
"exp = expiry_dates[0]"
|
||||
]
|
||||
},
|
||||
@@ -370,9 +370,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"current_price = float(info[\"Previous close\"][0])\n",
|
||||
"options_df = openbb.stocks.options.chains_yf(\n",
|
||||
" symbol, exp, min_sp=0.9 * current_price, max_sp=1.1 * current_price\n",
|
||||
")\n",
|
||||
"options_df = openbb.stocks.options.chains(symbol, expiration=exp, source=\"YahooFinance\")\n",
|
||||
"options_df.reset_index(drop=True, inplace=True)"
|
||||
]
|
||||
},
|
||||
@@ -925,7 +923,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n",
|
||||
"openbb.qa.bw_chart(\n",
|
||||
"openbb.qa.bw(\n",
|
||||
" ticker_data_all,\n",
|
||||
" \"Returns\",\n",
|
||||
" symbol,\n",
|
||||
@@ -946,7 +944,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n",
|
||||
"openbb.ta.bw_chart(\n",
|
||||
"openbb.qa.bw(\n",
|
||||
" ticker_data_all,\n",
|
||||
" \"Returns\",\n",
|
||||
" symbol,\n",
|
||||
@@ -959,83 +957,6 @@
|
||||
"bw_year = f.getvalue().decode(\"utf-8\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "c688fa89-3773-41fe-8ab8-bb6a610f2287",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# TODO Fix predictions virtual path on api refactored\n",
|
||||
"\n",
|
||||
"if predictions:\n",
|
||||
" regression_val = round(\n",
|
||||
" openbb.stocks.pred.models.regression.get_regression_model(\n",
|
||||
" ticker_data_all[\"Close\"], 1, 80, 20, 1\n",
|
||||
" )[0][-1],\n",
|
||||
" 2,\n",
|
||||
" )\n",
|
||||
" regression_val"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "66e51d40-3dca-46c0-abd6-4c1f04f59732",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# TODO Fix predictions virtual path on api refactored\n",
|
||||
"\n",
|
||||
"if predictions:\n",
|
||||
" fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n",
|
||||
" openbb.stocks.pred.regression(\n",
|
||||
" symbol, ticker_data_all[\"Close\"], 1, 80, 20, 1, external_axes=[ax]\n",
|
||||
" )\n",
|
||||
" fig.tight_layout()\n",
|
||||
" f = io.BytesIO()\n",
|
||||
" fig.savefig(f, format=\"svg\")\n",
|
||||
" regression = f.getvalue().decode(\"utf-8\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "90e77854-0652-4f62-9c0b-89d3fda456c6",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# TODO Fix predictions virtual path on api refactored\n",
|
||||
"\n",
|
||||
"if predictions:\n",
|
||||
" fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, figsize=(11, 3), dpi=150)\n",
|
||||
" openbb.stocks.pred.mc(ticker_data[\"Close\"], 30, 100, external_axes=[ax1, ax2])\n",
|
||||
" fig.tight_layout()\n",
|
||||
" f = io.BytesIO()\n",
|
||||
" fig.savefig(f, format=\"svg\")\n",
|
||||
" mc = f.getvalue().decode(\"utf-8\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "bb97c78c-4c4e-4e24-a2a1-29cdf47839c5",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# TODO Fix predictions virtual path on api refactored\n",
|
||||
"\n",
|
||||
"if predictions:\n",
|
||||
" fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n",
|
||||
" openbb.stocks.pred.regression(\n",
|
||||
" symbol, ticker_data_all[\"Close\"], 1, 80, 20, 1, external_axes=[ax]\n",
|
||||
" )\n",
|
||||
" fig.tight_layout()\n",
|
||||
" f = io.BytesIO()\n",
|
||||
" fig.savefig(f, format=\"svg\")\n",
|
||||
" regression = f.getvalue().decode(\"utf-8\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
@@ -1043,7 +964,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"income_df = openbb.stocks.fa.yf_financials(symbol, \"financials\")\n",
|
||||
"income_df = openbb.stocks.fa.income(symbol, source=\"YahooFinance\")\n",
|
||||
"data_df = openbb.stocks.fa.data(symbol)\n",
|
||||
"mgmt_df = openbb.stocks.fa.mgmt(symbol)\n",
|
||||
"mgmt_df[\"Info\"] = mgmt_df[\"Info\"].apply(lambda x: f'<a href=\"{x}\">{x}</a>')\n",
|
||||
@@ -1531,7 +1452,7 @@
|
||||
"metadata": {
|
||||
"celltoolbar": "Tags",
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.9.12 ('openbb-terminal')",
|
||||
"display_name": "Python 3.9.6 ('obb')",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
@@ -1545,11 +1466,11 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.9.12"
|
||||
"version": "3.9.6"
|
||||
},
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "811a8ebb02a69a0058b89c341233bddbf2d95a877272f2a215e4ccb65781d230"
|
||||
"hash": "cb66ba39c97f15743fbb79e204a841ea03600987d49579cfb0ffc8e8dd934c69"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
2
openbb_terminal/reports/templates/etf.ipynb
vendored
2
openbb_terminal/reports/templates/etf.ipynb
vendored
@@ -163,7 +163,7 @@
|
||||
"data = openbb.stocks.load(ticker)\n",
|
||||
"\n",
|
||||
"fig, (candles, volume) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n",
|
||||
"openbb.etf.candle_chart(\n",
|
||||
"openbb.etf.candle(\n",
|
||||
" symbol=ticker,\n",
|
||||
" data=data,\n",
|
||||
" use_matplotlib=True,\n",
|
||||
|
||||
14
openbb_terminal/reports/templates/forex.ipynb
vendored
14
openbb_terminal/reports/templates/forex.ipynb
vendored
@@ -162,7 +162,7 @@
|
||||
"source": [
|
||||
"# candle\n",
|
||||
"fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n",
|
||||
"openbb.forex.candle_chart(\n",
|
||||
"openbb.forex.candle(\n",
|
||||
" data=ticker_data,\n",
|
||||
" to_symbol=to_symbol,\n",
|
||||
" from_symbol=from_symbol,\n",
|
||||
@@ -216,7 +216,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"fwd = openbb.forex.oanda.fwd(\n",
|
||||
"fwd = openbb.forex.fwd(\n",
|
||||
" to_symbol=to_symbol,\n",
|
||||
" from_symbol=from_symbol,\n",
|
||||
")\n",
|
||||
@@ -474,7 +474,7 @@
|
||||
"# f = io.BytesIO()\n",
|
||||
"# fig.savefig(f, format=\"svg\")\n",
|
||||
"\n",
|
||||
"normality = openbb.t\\qa.normality(\n",
|
||||
"normality = openbb.qa.normality(\n",
|
||||
" data=ticker_data[\"Close\"],\n",
|
||||
")\n",
|
||||
"normality"
|
||||
@@ -490,7 +490,7 @@
|
||||
"# box and whisker plot\n",
|
||||
"\n",
|
||||
"fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n",
|
||||
"openbb.qa.bw_chart(\n",
|
||||
"openbb.qa.bw(\n",
|
||||
" symbol=ticker,\n",
|
||||
" data=ticker_data,\n",
|
||||
" target=\"Close\",\n",
|
||||
@@ -752,7 +752,7 @@
|
||||
"metadata": {
|
||||
"celltoolbar": "Tags",
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.9.12 ('openbb-terminal')",
|
||||
"display_name": "Python 3.9.6 ('obb')",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
@@ -766,11 +766,11 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.9.12"
|
||||
"version": "3.9.6"
|
||||
},
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "811a8ebb02a69a0058b89c341233bddbf2d95a877272f2a215e4ccb65781d230"
|
||||
"hash": "cb66ba39c97f15743fbb79e204a841ea03600987d49579cfb0ffc8e8dd934c69"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user