mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-01 23:12:21 +00:00
* Update trailmap.py (#4300) * Fixes Failing AutoDocs (#4304) * Fixes Failing AutoDocs * Update test_print_help.txt * Release 2.5.0 (#4355) * Rename SDK folder * Fixing all the tests I hope * Depreciate the sia menu * Fix routine script * Update SDK generation scripts * This needed fixing anyways * Regenerate SDK files * Update paths in sdk helpers * Regenerate the remains of the SDK * Fix candle not working with symbol via the sdk * Fix pydocstyle errors * deps * Add in Docstrings * Push to website since I need to upload images * typos * Add in Fixed Income Guide * Tests : fix cassette * changes to layout and adding more content * trailmap * poetry * updates to requirements files * add `_try_to_login` to sdk generation, fix `_chart` in `about()` url * sentiment analysis * refactor * changing to base model default * rounding * renewing poetry * fixed poetry * spacing * black * adds selectable models for realized volatility calculations * fixes line too long * Add intro guides to Fixed Income * Fix some missing docstrings * Fix website not working * missed a few * fix /economy/test_yfinance_view tests * fix etf/test_stockanalysis_model.py * fix etf/test_stockanalysis_view.py * fix test_stocks_controller * deprecating non used function * update financedatabase to 2.0.4 * Delete SIA from OpenBB Docs and SDK * Searching was not done properly for short name and index * changes the default data source for crypto.load * Fix tests I broke * Little fixy fix to remove duplicates * Fix tests * typo * adds check for empty dataframe * Patch Equity Report * Update so that image links to website * linting v2 * silly imports * adding tempfile * add imap unordered * reordering imports * Adding databento as a source (#4293) * First commit * Baby steps * Keys and sdk * Fix import for api key * Add SDK endpoints * Test + api checks * tests * roque print of api key * Changes * minor * custom timeout * improve timeouts --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Tests * Integration test * frozendict remove * update spec * rename sdk faq to troubleshooting * add hidden import * add hidden imports * imports again * valid url check * new lines and prompt * split imports * more spec * adds cones to the crypto-ta menu * Fix tests * Update code to reflect new changes to FinanceDatabase * Small bugfix for DCF if you have no ticker loaded * remove yfinance from news * add reverse fx choices * black * ruff * Add options greeks to the SDK * Linting * Delete rogue file and update test and add fixedincome to en.yml * fix for options screener * ruff * updates tests for options screener * reqs * updates more test files * rewrite for test_github_model * rewrite test for test_syncretism_view * removes test_view_available_presets[] * black * coverage * adds option screener preset * Update directories.py * len & set * set all list * adds unit testing for cones * ruff * pylint * adds options screener endpoint to SDK * test markers * Testing draft PR mode * Update package to v2.0.7 * Remove etf/screener and tests * Updated * Merge reqs * Updated readme * hook test for pyinstaller * Little fixy fix * Remove etf/scr from SDK * Update tests * Update hook-whisper.py * oops lol * Update sdk * update * Etf * removed old trailmap csv's * Update fixedincome text * add greeks to trail * rouge file * merge killed it * fix test * fix build failure * catch for error message * fix for frozendict * caching search and prompting on hub * whisper model prompts * Fix long/short issue and fix transform issue * separates volatility models from cones function * Introduce CPI functionality * improves error handling for volatility models when window length is too small * ur welcome <3 * additional sanity check for volatility_view * updates volatility_model test * black * Fix linting * Make cpi a little bit more robust * Add in missing value * sdk updates * update dep files * Update trail_map_forecasting.csv * import ordering pylint? * fix trailing comma * sorted trailmaps * remove one test artifact * rewrite test * Adds the missing pieces. * adds clickable URL in keys + Databento * adds databento images * adds images for Databento * update deps * req files * swap order in databento * ruff * mypy * lint * sdk * makes requested changes * ruff v2.. * replaces screenshot. * Removed because it shouldn't have been in this PR. * ruff v3 * Minor edit, move installation to position 2 instead of last * util linting changes * linting for controller * fix test * test * Revert some tests * Guess not * see if this sticks * fixes * Fix linters. Add --video if not provided * Checkout develop tests for keys * Release time * Revert papermill and update gh pages action * Fix shortname (#4356) * uninstall brotli on conda test * Fix issue 4316 (#4357) * Fix issue 4316 * Updating polygon_model + options_controller * Tests : FRED * ruff --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Chavithra PARANA <chavithra@gmail.com> Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: martinb-bb <105685594+martinb-bb@users.noreply.github.com> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Co-authored-by: luqazino@gmail.com <luqazino@gmail.com> Co-authored-by: colin99d <colin99delahunty@gmail.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Release/2.5.1 (#4368) * Fix routine script * Update SDK generation scripts * This needed fixing anyways * Regenerate SDK files * Update paths in sdk helpers * Regenerate the remains of the SDK * Fix candle not working with symbol via the sdk * Fix pydocstyle errors * deps * Add in Docstrings * Push to website since I need to upload images * typos * Add in Fixed Income Guide * Tests : fix cassette * changes to layout and adding more content * trailmap * poetry * updates to requirements files * add `_try_to_login` to sdk generation, fix `_chart` in `about()` url * sentiment analysis * refactor * changing to base model default * rounding * renewing poetry * fixed poetry * spacing * black * adds selectable models for realized volatility calculations * fixes line too long * Add intro guides to Fixed Income * Fix some missing docstrings * Fix website not working * missed a few * fix /economy/test_yfinance_view tests * fix etf/test_stockanalysis_model.py * fix etf/test_stockanalysis_view.py * fix test_stocks_controller * deprecating non used function * update financedatabase to 2.0.4 * Delete SIA from OpenBB Docs and SDK * Searching was not done properly for short name and index * changes the default data source for crypto.load * Fix tests I broke * Little fixy fix to remove duplicates * Fix tests * typo * adds check for empty dataframe * Patch Equity Report * Update so that image links to website * linting v2 * silly imports * adding tempfile * add imap unordered * reordering imports * Adding databento as a source (#4293) * First commit * Baby steps * Keys and sdk * Fix import for api key * Add SDK endpoints * Test + api checks * tests * roque print of api key * Changes * minor * custom timeout * improve timeouts --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Tests * Integration test * frozendict remove * update spec * rename sdk faq to troubleshooting * add hidden import * add hidden imports * imports again * valid url check * new lines and prompt * split imports * more spec * adds cones to the crypto-ta menu * Fix tests * Update code to reflect new changes to FinanceDatabase * Small bugfix for DCF if you have no ticker loaded * remove yfinance from news * add reverse fx choices * black * ruff * Add options greeks to the SDK * Linting * Delete rogue file and update test and add fixedincome to en.yml * fix for options screener * ruff * updates tests for options screener * reqs * updates more test files * rewrite for test_github_model * rewrite test for test_syncretism_view * removes test_view_available_presets[] * black * coverage * adds option screener preset * Update directories.py * len & set * set all list * adds unit testing for cones * ruff * pylint * adds options screener endpoint to SDK * test markers * Testing draft PR mode * Update package to v2.0.7 * Remove etf/screener and tests * Updated * Merge reqs * Updated readme * hook test for pyinstaller * Little fixy fix * Remove etf/scr from SDK * Update tests * Update hook-whisper.py * oops lol * Update sdk * update * Etf * removed old trailmap csv's * Update fixedincome text * add greeks to trail * rouge file * merge killed it * fix test * fix build failure * catch for error message * fix for frozendict * caching search and prompting on hub * whisper model prompts * Fix long/short issue and fix transform issue * separates volatility models from cones function * Introduce CPI functionality * improves error handling for volatility models when window length is too small * ur welcome <3 * additional sanity check for volatility_view * updates volatility_model test * black * Fix linting * Make cpi a little bit more robust * Add in missing value * sdk updates * update dep files * Update trail_map_forecasting.csv * import ordering pylint? * fix trailing comma * sorted trailmaps * remove one test artifact * rewrite test * Adds the missing pieces. * adds clickable URL in keys + Databento * adds databento images * adds images for Databento * update deps * req files * swap order in databento * ruff * mypy * lint * sdk * makes requested changes * ruff v2.. * replaces screenshot. * Removed because it shouldn't have been in this PR. * ruff v3 * Minor edit, move installation to position 2 instead of last * util linting changes * linting for controller * fix test * test * Revert some tests * Guess not * see if this sticks * fixes * Fix linters. Add --video if not provided * Checkout develop tests for keys * merge release into develop (#4359) * Update trailmap.py (#4300) * Fixes Failing AutoDocs (#4304) * Fixes Failing AutoDocs * Update test_print_help.txt * Release time * Revert papermill and update gh pages action * Fix shortname (#4356) * uninstall brotli on conda test * Fix issue 4316 (#4357) * Fix issue 4316 * Updating polygon_model + options_controller * Tests : FRED * ruff --------- Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com> Co-authored-by: Chavithra <chavithra@gmail.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Add pydantic to reqs and get ffmpeg in docker image * initialize session (#4360) * Unpin old version of jsonschema (#4365) * puts pip install openbb[all] inside quotes (#4366) Co-authored-by: James Maslek <jmaslek11@gmail.com> * Merge deps * Hotfix/bug #3837 (#3942) * Fix: Fixed spaces causing error in --sort flag at crypto/disc/... * Fixed minor issues * fixed formatting using black * Ran tests locally * fixed top command * reverse flag to gainers * reverse flag to losers * fixed dappradar verbose exceptions * tests * tests * tests --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> * Update release files --------- Co-authored-by: jeroen <jer.bouma@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Chavithra PARANA <chavithra@gmail.com> Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: martinb-bb <105685594+martinb-bb@users.noreply.github.com> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Co-authored-by: luqazino@gmail.com <luqazino@gmail.com> Co-authored-by: colin99d <colin99delahunty@gmail.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Brendan de Faria <brendan.defaria@gmail.com> * hotfix/Fix troubleshooting and adding lines (#4379) * Release Branch * fix print_pretty_prediction, avoid error on DummyBackend.__version__ * Update gh-pages.yml * fix removed start_required_configurations * fix gh-pages yarn lockfile, integration tests libs * ship it --------- Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Chavithra PARANA <chavithra@gmail.com> Co-authored-by: martinb-bb <105685594+martinb-bb@users.noreply.github.com> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Co-authored-by: luqazino@gmail.com <luqazino@gmail.com> Co-authored-by: colin99d <colin99delahunty@gmail.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Brendan de Faria <brendan.defaria@gmail.com>
182 lines
5.4 KiB
Plaintext
Vendored
182 lines
5.4 KiB
Plaintext
Vendored
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "e9ad60bc",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import os\n",
|
|
"import ipywidgets as widgets\n",
|
|
"from openbb_terminal import OpenBBFigure, theme\n",
|
|
"\n",
|
|
"import yfinance as yf\n",
|
|
"from IPython.display import display"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "beb36881",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"opts = [\n",
|
|
" \"lastTradeDate\",\n",
|
|
" \"strike\",\n",
|
|
" \"lastPrice\",\n",
|
|
" \"bid\",\n",
|
|
" \"ask\",\n",
|
|
" \"change\",\n",
|
|
" \"percentChange\",\n",
|
|
" \"volume\",\n",
|
|
" \"openInterest\",\n",
|
|
" \"impliedVolatility\",\n",
|
|
"]\n",
|
|
"\n",
|
|
"\n",
|
|
"def clean_str(string):\n",
|
|
" new_str = \"\"\n",
|
|
" for letter in string:\n",
|
|
" if letter.isupper():\n",
|
|
" new_str += \" \"\n",
|
|
" new_str += letter\n",
|
|
" return new_str.title()\n",
|
|
"\n",
|
|
"\n",
|
|
"def format_plotly(fig: OpenBBFigure, x, y, ticker, expiry, inst):\n",
|
|
" fig.update_yaxes(title=clean_str(y))\n",
|
|
" fig.update_xaxes(title=clean_str(x))\n",
|
|
" expires = \", \".join(expiry)\n",
|
|
" title = (\n",
|
|
" f\"{clean_str(y)} vs. {clean_str(x)} for {ticker.upper()} {inst}s on {expires}\"\n",
|
|
" )\n",
|
|
" fig.update_layout(\n",
|
|
" margin=dict(t=40),\n",
|
|
" autosize=False,\n",
|
|
" width=1000,\n",
|
|
" height=500,\n",
|
|
" title=dict(\n",
|
|
" text=title,\n",
|
|
" y=0.98,\n",
|
|
" x=0.5,\n",
|
|
" xanchor=\"center\",\n",
|
|
" yanchor=\"top\",\n",
|
|
" ),\n",
|
|
" )"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "f8c2f65c",
|
|
"metadata": {
|
|
"tags": [
|
|
"parameters"
|
|
]
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"class Chart:\n",
|
|
" def __init__(self):\n",
|
|
" self.last_ticker = \"\"\n",
|
|
" self.dfs = {}\n",
|
|
"\n",
|
|
" def update(self, ticker, expiry, inst, x, y):\n",
|
|
" if ticker:\n",
|
|
" stock = yf.Ticker(ticker)\n",
|
|
" if ticker != self.last_ticker:\n",
|
|
" exp_w.options = stock.options\n",
|
|
" self.last_ticker = ticker\n",
|
|
"\n",
|
|
" if expiry:\n",
|
|
" fig = OpenBBFigure()\n",
|
|
" for expire in expiry:\n",
|
|
" if expire not in self.dfs:\n",
|
|
" self.dfs[expire] = stock.option_chain(expire)\n",
|
|
" group = self.dfs[expire]\n",
|
|
" df = group.calls if inst == \"Call\" else group.puts\n",
|
|
"\n",
|
|
" fig.add_scatter(\n",
|
|
" x=df[x],\n",
|
|
" y=df[y],\n",
|
|
" mode=\"lines\",\n",
|
|
" connectgaps=True,\n",
|
|
" name=expire,\n",
|
|
" )\n",
|
|
"\n",
|
|
" format_plotly(fig, x, y, ticker, expiry, inst)\n",
|
|
"\n",
|
|
" if os.environ.get(\"SERVER_SOFTWARE\", \"jupyter\").startswith(\"voila\"):\n",
|
|
" fig.show(\n",
|
|
" config={\"showTips\": False, \"displaylogo\": False},\n",
|
|
" renderer=\"notebook\",\n",
|
|
" )\n",
|
|
" else:\n",
|
|
" fig.show(config={\"showTips\": False, \"displaylogo\": False})\n",
|
|
"\n",
|
|
"\n",
|
|
"x_w = widgets.Dropdown(options=opts, value=\"strike\", description=\"X\")\n",
|
|
"y_w = widgets.Dropdown(options=opts, value=\"lastPrice\", description=\"Y\")\n",
|
|
"tickers_w = widgets.Text(description=\"Ticker\")\n",
|
|
"exp_w = widgets.SelectMultiple(description=\"Expiry\")\n",
|
|
"inst_w = widgets.Dropdown(options=[\"Put\", \"Call\"], value=\"Call\", description=\"Type\")\n",
|
|
"\n",
|
|
"select_opt = widgets.VBox([tickers_w, exp_w])\n",
|
|
"select_plot = widgets.VBox([inst_w, x_w, y_w])\n",
|
|
"controls = widgets.HBox([select_opt, select_plot])\n",
|
|
"\n",
|
|
"chart = Chart()\n",
|
|
"stocks_view = widgets.interactive_output(\n",
|
|
" chart.update,\n",
|
|
" {\"ticker\": tickers_w, \"expiry\": exp_w, \"inst\": inst_w, \"x\": x_w, \"y\": y_w},\n",
|
|
")\n",
|
|
"\n",
|
|
"title_html = \"<h1>Option Chain Dashboard</h1>\"\n",
|
|
"app_contents = [\n",
|
|
" widgets.HTML(title_html),\n",
|
|
" controls,\n",
|
|
" stocks_view,\n",
|
|
"]\n",
|
|
"app = widgets.VBox(app_contents)\n",
|
|
"display(app)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "a84c7390-6b43-4a25-8aa2-31aa84f52605",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3 (ipykernel)",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.8.12"
|
|
},
|
|
"metadata": {
|
|
"interpreter": {
|
|
"hash": "e896a00ead8b521528d79ac9ef24990696f2b751eb283ab8e0d078c9c4971ffc"
|
|
}
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|