mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
* test * ultima description (#5541) * Updating showcase page (#5543) * updating showcase page * use sdk instead * add new bot command autopost docs (#5530) add new bot command autopost docs to docs.openbb.co Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/ultima improvements (#5553) * tweaks for monetization * fix linting issue * fix: Modify 'load' behavior to append data to existing sheet (#5503) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Fixed 'worksheet not found' error during export to an existing sheet * Changes: * Now if the sheet exists in the xlsx file it will ask the user if he wants to replace/append/create new sheet --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * added platform API integration test to Nightly build (#5571) * Add columns to `stocks/search` (#5565) * Add columns to `stocks/search` isin, cusip, figi, composite_figi, shareclass_figi * Update test_search[False].txt * Update test_search[True].txt * Delete tests/openbb_terminal/stocks/cassettes/test_stocks_helper/test_search.yaml * Create test_search.yaml --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * updating ultima urls (#5587) * fix: A value is trying to be set on a copy of a slice from a DataFrame #5582 (#5591) * Update README.md (#5598) * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * fix docs (#5646) * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update settings.md (#5665) * fix front matter (#5667) * #5633 adding comma every 1000 (#5652) * #5633 adding comma every 1000 * pylint --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Hotfix/reports model render report sanitize inputs (#5669) * Adding more robust special character handling to create_output_path().Addresses https://github.com/OpenBB-finance/OpenBBTerminal/issues/5299 * Running black linter on code to conform to OBB style guides. --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * hotfix/fix-gov-histcont: Fix #5650 - /stocks/gov/histcont (#5676) * fix histcont * some cleanup * remove sort line * 12-31 not 12-12 * columns_keep_types * remove space in regex (#5675) * Pin openai (#5685) * Clarified stocks/ta empty recom object message (#5468) * Clarified stocks/ta empty recom object message * black * lint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * improved market cap value extraction (#5169) * improved market cap value extraction * pylint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Release/3.2.4 (#5704) * 3.2.3->3.2.4 * Changelogs * new changelog * OpenBB Platform v4 (#5225) * change location * check something * add cache * fixed auth w/@IgorWounds and @montezdesousa * fixes for econometrics * include Darren auth suggestions * some routers included if dev + chg hub backend var * coverage router should not be here * update docker readme * forgot to check auth here * Change extension imports * update docstrings and readme * headers function wasnt being called, just referenced * relative import * econometrics add headers everywhere * Fix QA * Fix TA * Fix test * Fix python interface QA and TA * Lint * Cleanup * Change path * make the changes and some etf models * tests for command_runner * ruff * solving naming issues on pytest * Update some docstrings, fix typos and lint * solving econometrics instantiating wrong openbb * chaging the way pytest runs * messing around with the imports * ruff * Change template to add platform considerations (#5533) * change template to add platform considerations * @the-praxs suggestions * solving __pycache__ issue * removing typo * ci yml * making linters happy (i guess) * Improve Omega Ratio and docstrings * chaging pro validation hash * ruff * Fix OLS Summary and lint * Add OECD Provider for economy extension (#5534) * Add record to docs * update a couple of cboe models * Fix econometrics bugs. Make tests pass. Lint. * black * ruff * pydantic v2: remove deprecated Extra * pydantic v2: self.dict -> self.model_dump * revert pydantic * revert the revert * try 1: pin urllib3 < 2 * Revert "try 1: pin urllib3 < 2" This reverts commit3736c311cb. * Revert dep * Fix * re-lock * Skip all tests when doing cspell in pre-commit * Resolve linter errors * Add OECD to install script * Add OECD * Resolve more linter errors * Exclude static files of v4 python from ruff * More linting * Another attempt to resolve even more linting errors * Change how Literal is used * ticker. symbol. consistent. @piiq * change ticker field in Stock Search to is_symbol * Update Cboe model for stocks_search -> is_symbol parameter. * Fix issue * Lint * Small QA to rename SDK to Platform (#5544) * SDK -> Platform in docs * renamed in core * renamed in openbb `init` * `sdk` variable renamed as `platform` --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * `validator` -> `field_validator` in standard models * Standard convention for multi-ticker symbols (#5549) * standardize symbol input param in forex and crypto historical data * static * linting * Fix stock_search integration test params * Update dependencies and linting on the CI (#5550) * Remove ruff and black from platform dependencies * Update codespell configuration * Lint python code * Add toml and tomli to root dev dependencies * Update requirements.txt files * Fix buggy docstring in python package methods (#5548) * fix buggy docstring for methods * remove space * fix typing * avoid name collision with validator * Revert "avoid name collision with validator" This reverts commit8a30a44555. * typing * rebuild * python 3.8, ParamSpec not available * lint * ruff noqa * Merge with develop (#5551) * Charting extension integration tests (#5547) * initial proposal for integration tests on the charting extension * int tests for charting generation * python generator * ruff * boilerplate templates * python tests * tests for the api * using body instead so data don't get redefined * unit tests for coverage * ruff * docstrings * unnecessary access to keys() * Add trading economics economic calendar * dev install * Data Models disposition on the website (#5538) * pydantic v4 * flat structure * md files * Revert "md files" This reverts commitbd2170e2ad. * improve command descriptions * nice title and description * human readble data model names on left panel * implementation details section * content markdown files * markdown versioned files * showcase page * updates --------- Co-authored-by: tehcoderer <me@tehcoderer.com> * everything except tests * fix `datetime.date` import in fetcher test * modified url to remove `api_key` placeholder * record test * api key is called c here * fixed fetcher test for api key * recorded tests * refactor * life is ruff * codespell * Make Intrinio options chains great again (#5540) * add multithreading * cleanup * linting * use dateutil.parser * removed `TICKER_EXCEPTIONS` * modified `date` and `type` fields in standard model * set alias for `date` and `type` to match standards * static * static * Hotfix/fix post tests (#5555) * Fix econometrics * Fix ta * Fix qa. Remove intrinio to not be rate limited * Lint * Fix typo * obbject tests (#5558) * obbject tests * ruff * fix dev_install * fix unittests * black on nox * black on nox * nox * fix fetcher test so it can compare dates * fix intrinio tests * ruff * change to model_dum() instead (#5561) * Passing tests (#5560) * Passing tests * fix options * Fix most tests and bugs * fix forex missing params * make symbol upper in polygon fx pairs * fix fixedincome integration tests (#5564) * Fixing charting api integration tests (#5562) * fixing charting api integration tests * black * fix stocks less five API fails * fix the 5 failing stocks integration tests * recapture fmp stock news unit test * fix fmp forex api test * couple more forex integration fixes * changing the request to always use the legacy session. @jmaslek this is was broken for 3.8 and 3.9; with this change apparently all versions work - lemme know if you see any issue with this change * ruff * fix ta * add missing param * fix testers for the api * fix globalnews to use images instead of image * remove unncessary pandas import * econcal int tests * update gitignore * fix get_querystring to support lists * add missing parameters --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> * Stock Historical standardization and UX improvements (#5457) * polygon add interval standard param * attempt at standardization * Alpha Vantage params standardization * rename `get_intervals` and fixed bug for extracting wrong value * missed changing it in `extract_data` * linting * polygon cleanup * modified `start_date` & `end_date` type to `datetime` from `dateType` * standardized intrinio stock historical params * fixed yfinance * linting * revert start and end date to dateType from datetime * fix alpha vantage * changed param * fix intrinio infinite loop * `validator` is `field_validator` * revert time params and fixed intervals * `outputsize` alias set in `Field` * set interval description using in-build dict * yfinance stock param standardization * static * intrinio cleanup * Polygon add api params as `PrivateAttr` * modified yfinance params to `PrivateAttr` * intrinio remove overriding date params * fixed description for AV adjusted param * fix alpha vantage intraday not working * re-record and pass unit tests * pass integration tests * Update test --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * Fix econcal endpoint (#5567) * fix econcal for python interface * fix econcal tests * fix non supported json output * Fixes FMP index endpoint to get 1 day interval data (#5535) * fix FMP endpoint for getting index data for `1day` interval * fix `open` type to prevent validation error * modifed `validator` to `field_validator` * type of fields is `StrictFloat` * re-record and pass test * linting * `validator` -> `field_validator`, a3'd everything * Fix regression in tests. Lint * updating the integration test actions * Fix typo * Fix typo * Fix import * Publish versions `a3` to Pypi (#5568) * bump versions and script to publish * small improvements * uncomment exception * openbb * publishing guidelines * improve docs * add providers to economy api * make symbol required in stock_quote * Fix keys * Fix oecd * add comma * revert * Add quotes * Sleep * Improve tests * Improve * Feature/query transform (#5566) * inject query into transform_data * swap query and data * update missing fetchers * last test failing * sig test fetcher * black * av add `query` to `transform_data` call * transform_data: missing refactoring * fix uvicorn command in the doc * Automated examples (#5576) * Automated examples * Fix bug * Lint * static assets built on 3.8 * Revert "static assets built on 3.8" This reverts commitfb82ff7bd9. * remove assets * static assets on 3.8 * static assets on 3.8 * Wrap in quotes * Improve wrap * minor fix * rebuild 3.8 * Fix bug * Fix edge case * Lint * rebuild --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> * use SecretStr for sensitive fields (#5578) * use SecretStr for sensitive fields * fix * docstring * Add tests for provider (#5583) * Add tests for provider * Test standard models * Lint * Fix standard model issues. Co-authored-by: @the-praxs * linting * `symbol` -> `is_symbol` in `economy.index_search` * static --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * feature/v4-biztoc-provider: Adds Biztoc provider and GlobalNews (#5546) * add biztoc provider * duplicate field * black * request headers * recapture test * move stuff around * add integration tests * duplicate OECD entry in dev_install * duplicate entry for oecd in pyproject.toml * Add Biztoc to workflow * update readme: credentials * Add Preferences to README * improve tests * fix biztoc * obbject pylint * Bug fix: serializ SecretStr before dumping to json * export credentials as json (#5592) * Check for wrong, changed, or outdated params. (#5597) * Improving `economy.cpi` for the FRED data (#5602) * remove multiindex using coding magic * Update field descriptions --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Improve error message. * Improve * Test tests (#5607) * Test tests * Add test * 4.0.0a4 PyPI publishing (#5608) * changes to publish * fix mini conflict * typo * cleaned `descriptions.py` * fix description in `cpi.py` * Add ETF extension to v4 (#5609) * Add etf extension with search data model * Add FMP ETF search * Add fetcher tests * Add ETF historical price from yfinance (#5610) * Add etf extension with search data model * Add FMP ETF search * Add fetcher tests * Add etf historical price standard model and route * Add etf historical data from yfinance * Add unit tests * Fix linter error. Organize imports * Update test data * Revert common descriptions erased by CPI PR * remove `symbol` from data for `stocks.ca.peers` * Test docstrings (#5613) * Test docstrings * fix minor bugs w/@IgorWounds * static only w/@IgorWounds * fix `importance` param in `economy.econcal` * right static only w/@IgorWounds * Fix econcal and add tests to noxfile * fix econcal static * re-record --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Clean up the newly created ETF extension (#5611) * Add ETF to dev_install bundle * Add integration tests for openbb-etf * Patch integration test generator scripts to produce lintable code * Add py.typed markers for extensions * user preferences descriptions (#5593) * user preferences descriptions * typo * Feature/v4-sec-provider: Add SEC provider to V4 (#5556) * coerce string type, add default=None * add sec provider and FTD function * update description * ruff * data model definitions in standard model already * duplicate oecd entries in dev_install and pyproject * actually commit * integration test * add stock search to SEC * add company filings for SEC provider * integration tests * remove duplicated line * ruff * **kwargs in Transform Data * some helper functions for later * black * add helper for mutual fund and etf lookup * add some SEC lookup helpers to a new regulators extension * black * ruff * fix test param * take institution filter out of sec stock_search * ruff * remove URL that codespell doesn't like * add cik-to-ticker map * add litigations rss feed * make openbb-regulators a dependency of openbb-sec * add SIC search * improve ftd and remove BeautifulSoup from SEC dependencies * fix parsing the zip files pre-2009 * ruff * update descriptions * recapture ftd test * tests params * typo * change limit param to 1 in test_sec_stock_ftd * Add didiers to_records method (#5588) * Add didiers to_records * unused import * Bring back polars + do what igor suggested * Make the output consistent with what it was. * Black ? * spelling. oops. almost like we have a pre commit or something * Feature/v4-price-performance: % returns for various horizons, comparable across multiple tickers. (#5618) * coerce string type, add default=None * add price_performance endpoint from FMP * black * extra period in docstring * ruff * forgot one file * Feature/ipo-calendar: V4 IPO Calendar (#5605) * coerce string type, add default=None * add intrinio ipo calendar * fix typo * sort __init__ * fix description * make requested changes * update test params * black * test updates * etf integration * Add disc router and WSJ provider * OBBject extensions (#5612) * changes to core * bug? * docstring * doc * Update credentials.py * fix model_dump * create extensions * fix docstring * doc * revert change query_exc * doc * fix container test * redirect obbject test patch * doc * rename method * move decorator to extension file * rename method extend_obbject * changes in creds model * avoid credential racing * doc * rename prop * doc * doc * remove comment * comment some code * free extension names * docstring * doc * docs * Hotfix/fix-v4-economic-calendar: Add FMP to Econ Calendar and fix some TE bugs (#5580) * coerce string type, add default=None * adds fmp to economic calendar and fixes some things with TE * ruff * etf integration test * missing provider for test * rename te cassette to economic_calendar * fix test * rename tests --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Add stocks disc endpoints (#5630) * Add stocks disc endpoints * Explicit * Lint * Add tests * Bump timeout * Feature/disc router (#5616) * Add disc router and WSJ provider * Lint * Lint * Move endpoints under ETF router * Update etf_performance.py * Add ETF info and sector exposure from FMP (#5620) * Add ETF info from FMP * Add integration tests * Add unit tests * Add etf sectors endpoint * Add etf sectors fmp endpoint * Omit nested sector list from fmp info data * Update tests and test data * Update test data * Specify provider explicitly in integration tests * Update tests * Skip yfinance etf historical test * Fix linter errors after the merge * Fix more linter errors * Fix failing and add missing tests * Fix integration tests * Fix calendar ipo tests * Add ETF holdings and holding report dates from FMP (#5629) * Add ETF info from FMP * Add integration tests * Add unit tests * Add etf sectors endpoint * Add etf sectors fmp endpoint * Omit nested sector list from fmp info data * Update tests and test data * Update test data * Specify provider explicitly in integration tests * Update tests * Skip yfinance etf historical test * Add etf holdings and holdings date routes and standard models * Add fmp holdings and holding dates fetchers * Update holdings fetcher to properly handle date object inputs * Add unit tests * Add integration tests * Black after merge * Fix test input data format * Disc router for equities. (#5640) * Disc router for equities. * add tests * Bug fixes in financial statements (#5537) * `validator` to `field_validator` in standard models * Polygon add `ttm` to `period` param * Revert "Polygon add `ttm` to `period` param" * Polygon add `ttm` to param `period` * `EarningsCallTranscript` standard model removed `quarter` param * use `tag` instead of `name` for correct field name * fix url for intrinio income statement * modified intrinio cash flow `transform_data` function * set optional data fields and validate dates * fix insider trading not fetching recent data * linting * refactoring * refactoring * set param alias in fmp stock insider provider model * get all quarter data for intrinio * add `limit` param to `stocks.fa.ins` * refactoring and linting * removed additional comment * linting * re-recorded and fix tests * cash flow standard model field type to `StrictFloat` * Intrinio cash flow model fixed to get all quarters' data * linting * refactoring * financial statement standard model field type to `StrictFloat` * Intrinio financial statement model get all quarter data * set `period` type to `Optional[str]` * add `period` param to balance sheet provider models * add `period` param to cash flow provider models * use alias in model dump * remove `ttm` from `period` param * revamped intrinio financials * fixed incorrect description for `limit` param * modified tests for `balance`, `cash` and `income` * re-recorded tests * skipped intrinio financial statement fetcher tests * Add ETF county weighting command with FMP data (#5645) * Remove code that wrongfully infers the filing date as end of quarter * Add etf countries command with fmp data * Add countries command to etf router * Update sector and country weighting fmp models * Fix docstring typo * Add unit tests and update mock data * Add integration tests for etf.countries * Bring back missing integration tests * Fix economic calendar integration tests * fix missing data in intrinio financials * removed inutile params from Polygon financial statement models * Intrinio IPO overhaul * tests fixed and re-recorded * Add ETF holdings performance with FMP data (#5659) * Add etf holdings performance endpoint * Add tests * Fix failing polygon fetcher tests * Split long holdings lists into chunks and update test data * Change chunk length to 500 tickers * Add stock search from FMP (#5642) Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Feature/v4 pypi (#5579) * improvements to the publish script * move scripts * initial script that builds the package * adjustments on the docs * test pypi workflow * add hour and minute to version * black * ruff * duplicate file * moving files instead * build throught the script instead * update nox file * integration tests workflow * change workflow * fix dev_install * fix in sed cmd * testing the platform only * commenting out the publishing * fix run commands * improvements to the publish script and doc * fix publish script * updating the script and the workflow * feature/v4-pypi nightly (#5589) * init * Update nightly.py * cleanup * init file * not referencing dev_utils * updating obb platform key * revert * Increase warmup time * project name on pyproject and adding the --pre flag on readme * moving to the build folder * fix noxfile * reflecting the moves on the import statements * fix pyproject path * ruff * fix paths * fix super typo * update workflows * moving the pypi terminal files into its folder --------- Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * economy.calendar nasdaq (#5628) * add quandl econcal * unittest * add integration tests * replace   * fix bug TE importance * small fix * remove stuff from quandl * add nasdaq provider * add nasdaq to install files * Update test_economy_api.py * test * quandl leftovers * remove quandl econcal test * lint * replace   * ruff * lint * update nasdaq gmt * validate countries * here * no need for this * fix calendar tests * static * static * remove error * static * readme + website * readme * remove changes TE * typo * fix unittest * fix tests * Update __init__.py * Update economic_calendar.py * revamped model and added helpers for date range --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Feature/v4-dividend-calendar: Adds Nasdaq dividend calendar and moves the command out of fundamental_analysis (#5672) * add nasdaq dividend calendar and move out of fundamental_analysis * black * ruff * add random-user-agent to pyproject.toml * add nasdaq ipo calendar * add nasdaq flag for SPO to IPO calendar * add spo test param * black * dividend test * fix transform_query - nasdaq_calendar_ipo * bring back different headers for ipo calendar * remove references to test * Add disc endpoints (#5660) * Add Quandl top retail * Add tests * Add Seeking Alpha * Add Filings * Change Provider * Fix test * Add dev_install * static * static correct * y u forget me * updated deps * static --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * using dev install (#5673) * Expanding the `fixedincome` menu (#5655) * models and fetcher * making the fetcher visible * std model * adding the command * improvements to the models * typo * adding the command * imrpovements to dwpcr * standard model for ecb int rates * adding the fetcher for fred * standard model of ice bofa * add ice_bofa command * ruff * ice bofa fetcher * moody std model * moody * std model * add cp command * unused import * cp * spot * ruff * hqm * tmc * ffrmc * tbffr * ruff * typing fixes * buggy dates * fred fetcher tests * ruff * adding ecb as a provider * adding new provider related stuff * adding the new command eu_ycvr * models * test for ecb fetcher * Feature/v4 fixedincome int tests (#5661) * integration tests * happy ruff * mini adjustment * ruff * typo * verbose type * fix tests * docstrings everywhere and an happy pydocstyle * fix tests * Feature/user-cache-dir: Add User Preference for the Cache Directory (#5621) * add user preference for storing cached data * ruff * fix tests? * fix test key error..? * etf integration test fix * add cache dir to SEC * black * improve docs structure for V4 (#5586) * improve docs structure for V4 * moving over changes * Add Docs to the navbar * add some, re-order sidebar * fix sentence * add docs install to source instructions * insert a couple of links, fix a typo * big terminal docs usage revamps * improve toggle component for tutorials * get rid of TOCs for all terminal docs for consistency and simplicity * improve platform docs * improve bot docs content structure * remove index from bot docs * improve ON THIS PAGE to only display TOC if at least 1 element * make edit this page text and icon on same line * add author and date to docs * add basic syntax page to usage * sidebar order for usage section * move api start command to the top with the import python import * some install page additions * small improvement * refactor routines section * Update introduction-to-routines.md * Update pipeline-of-commands.md * Update introduction-to-routines.md * Update routines-for-power-users.md * Update community-routines.md * update keyboard hotkey macros * askobb page * Update askobb-feature.md * Update index.md * Update index.md * Update index.md * Update index.md * fix images * remove HeadTitle from all files where it exist * get rid of extra spacing in markdown * small update * small edit * need index at the start because of main path when homepage of docs * use openAI to create SEO for front matter on my behalf * remove table of content from sdk page * finish improving metadata SEO for SDK docs * update duplicate header * update HeadTitle to be more specific on product * remove index from bot telegram reference * delete duplicated title for platform reference * another update * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * start PR so screenshots can get attached via GitHub website * Update qa.md * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * Update crypto introduction.md * titles * another title * Update crypto dd.md * Update defi.md * Update disc.md * Update nft.md * Update onchain.md * Update ov.md * Update introduction.md updates URL * Update introduction.md add HeadTitle * Update ba.md * Update comparison.md * Update dark-pool-shorts.md * Update disc.md * fix docs (#5646) * Update fa.md * Update gov.md * Update ins.md * Update tradinghours.md * Delete website/content/terminal/menus/stocks/options/screener.md * Update Options introduction.md * Update screener head title * Update screener TOC * Update econometrics.md * Update economy head title * Update etf.md * codespell * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Contributing guidelines (#5615) * intro section * what's expected sections * improve sections * improve sections and move how to add a data point * moving qa under contributor * better intro * moving the sharing section * better expectations * small intro to the contributor guidelines * moving things under the contributor section * there is no pre commits on the platform yet * dependency management * best practices for extensions * typo * collapse options subfolder * codespell * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update fixedincome.md * url * Update forecast.md * Update settings.md (#5665) * Update forex.md * fix front matter (#5667) * Fix conflict markers that got into markdown during previous merges * Fix front matter list formatting * Fix typo * small thing * fix hyperlinks * Update .codespell.ignore * output_type options * Architectural considerations * Update sidebar to hide pro section by default * Minor copy changes * TET pattern * import statements * clarification on preferences * Minor copy changes * Lint markdown and python * fix: open index on collapsible root elements * remove old content * options title * Fix linting errors * Refactor sidebar label to url mapping condition --------- Co-authored-by: andrewkenreich <andrew.kenreich@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: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Add multi-ticker support to etf_countries (#5670) * add multi-ticker support to etf_countries * remove commented-out lines * normalized percent points * percent -> percentage * Fix Nasdaq Econ Calendar Fetcher (#5668) * fix nasdaq econ cal request * more html tags * add random-user-agent to pyproject * another edge case - 24H -> 00:00 * Feature/v4-unusual-options: Adds unusual options endpoint. (#5677) * add unusual options fro Intrinio * test params * move sorting * Change type * update FMP fetcher to use the V4 endpoint (#5681) * Fix price performance not parsed correctly when there is only 1 ticker (#5678) * Add crypto search standard model and FMP data for it (#5679) * Apply renaming to news data (#5684) * inegration complete * reformatted for black * fix ruff issues * revised integration * changes to versions in pyproject.toml and updated lock files * Rename models * Update tests * Fix typos here and there * Update routers * Apply rename to ultima * Properly mock api key * Mock ultima api key --------- Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> * Feature/v4-market-snapshots: Adds full market snapshots (#5473) * add stocks market snapshots from fmp * add fmp fetcher test * unused imports * add polygon to market_snapshots * update fmp market_snapshots * black * pydantic2 things * updates * change validate_obj to model_validate * polygon cleanup * tests * descriptions * black * data description * minor adjustments, using less local variables, improving readability and removing pandas * better structure * minor adjustments * lint * fix int tests --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Add NBBO Quotes, with historical, to `obb.stocks.quote()` (#5617) * coerce string type, add default=None * add polygon stock quote * limit cleanup * add greater/less than to params * limit param * black * tests * fix tests * test_etf * rename model and function to NBBO * add standard model for nbbo * improve standardization * not redifining builtin max * fix input params * integration test params * removing unused import Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * revamped code * re-recorded nbbo test * added symbol validator * added alias in field * Stock news -> Company news --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * hotfix/update-quandl-to-nasdaq: Merge Quandl + Nasdaq (#5682) * merge quandl nd nasdaq * dev_install.py * test param name * economy python integration test * Add more input types to data processing commands (#5453) * adding more supported types to data processing commands * ruff * removing unused import * docstrings * data processing types covertion * data description * test filters * ruff * fix package builder tests * ruff * removing print * Add stocks/dps module (#5638) * short volume * pyproject missed * add sec short interest with days to cover * Add FINRA OTC endopoint * some tests * rest of unit tests * Integratin test scripts * dev install * linters caught by pre commit * lines too long * Last test files * maybe it needs a lock file? * thanks pratty * Maybe ill actually listen to pratty next time * sec test date freeze * I cant hit buttons * re record tests * tests 3 * Stockgrid test * regen int test * more testing * lint * moved these fns * dis killing me * one more test * last one * Update integration tests * Fix tests picking up wrong dps route --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Rename Forex to Currency (#5687) * restore fields as optional (#5686) * Rename Crypto (#5689) * added `crypto.price.historical` * static * fix tests * fix incorrect label * Move model from sec to finra (#5692) * Update toml * fixed deps * add openbb-etf lock file * cleanup * cleanup (#5694) * Rename Fixed Income (#5695) * Rename Fixed Income * Add routers * Rename stocks to equity (#5688) * Rename stocks folder * Rename openbb_stocks package * Rename routers * Reroute equity menu * Update routes based on feedback * StockNews -> EquityNews * StockInfo -> EquityProfile * Rename Equity calendars * Equity peers rename * Rename discovery * Rename fundamental * Rename price command models * Rename shorts * Update charting router * Fix seeking alpha upcoming release date * Fix linting errors * Update tests * Fix tests * Skip econometrics api tests because it's python only * Update integration tests and test data * Historical analyst estimates * Skip cboe options chain test. Unable to record vcr cassette * re-record cboe cassettes * Document CBOE unit test creation caveats --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Feature/files-for-igor: Adding a few standard models for Igor (#5699) * add some standard models for Igor * codespell * update descriptions * Add devtools metapackage (#5703) * Add openbb-devtools metapackage * adding devtools to the dev_install script --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Rename econometrics commands to be more verbose (#5702) * Expose command to model map (#5706) * Rename ta qa (#5708) * Rename ta folder * Rename ta to technical * Rename qa folder * Rename qa to quantitative * Rename the actual routes in quantitative * Equity cleanup (#5707) * cleanup * static * renaming to equity cc @the-praxs * Proof reading --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Don't enforce imperative for first word of the docstring * Remove ultima from default extensions * Rename `economy` and create `index` extension (#5705) * renamed economy and re-recorded tests * static * market indices * european indices * fred indices * index constituents * tests * correct package name * oops * static * linting * Move COT commands to regulators * Rename economy.list to available_indices * Rename GDP models and clean up * Fix charting tests * Drop _indices from available_indices command * Fix obbject to_dict test --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Rename etf/disc (#5715) * Docs/v4-working-docs: PR to Work on V4 Docs (#5693) * Revert changes related to pydantic2 made into v3 code * Revert fred model changes in v3 * Revert pydantic2 databento model changes in v2 * Update some names and v3 lock file * Clean up openbb/package before the beta release * Platform publishing procedure (#5701) * update instructions * introducing the version script * publish message * fix platform path * reflecting version changes * getting version from installed packages instead * removing toml from dependencies * Changes to get `a7` out (#5697) * changes to get a7 out * etf menu on the pyproject.toml * poetry lock * bump `openbb-etf` to `a5` to match version * updated deps * removing ultima * removing references to a4 cc @the-praxs * Bump index menu version * poetry lock --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Update publishing instructions * Bump core dependencies in extensions and providers * Add changes to the publish script following the beta release * Update the versions in static extension map and openbb metapackage --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: tehcoderer <me@tehcoderer.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> * Hotfix/pypi openbb terminal (#5719) * renaming the project * documentation changes * Finishing touches to the publishing procedure (#5728) * finishing touches to the publishing procedure * grammar improvements * Run tests on develop (#5725) * Run tests on develop * Add a check that files changes in platform * Seprate Intrinio financials data tags into a different command (#5723) * add `ebit` field in income statement standard model * only add required data tags * remove calculations data * use `name` key instead of `tag` key * set `period` as required in data * remove `period` and `cik` from provider models * add `equity/fundamental/search_financial_attributes` with tests * clean descriptions file * add `equity/fundamental/financial_attributes` with tests * set `value` as `Optional` * Fix threadpool test error (#5734) * Remove ultima from deps (#5736) * remove ultima from deps * skip ultima test * black * change skip location * try except statement to avoid error on the ci * new currency reference rates pr (#5724) * point files to linters (#5739) * remove news from equity (#5741) * Add tiingo provider (#5740) * first commit * things * Add news endpoints * CryptoHistorical * Add currency and trailing dividend yield * things working * deps * fix pre commit things * tests? * black on the tests * pratty told me to add it * integration tests * added helpers * crypto revamped * currency revamped * trailing dividend yield revamped * equity historical revamped * company news overhauled * global news overhauled * remove `tags` param from news models * crypto correct `exchanges` description * james smh * re-recorded fetcher tests * fixed integration tests * econometrics smh * james smh again --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Add `derivatives` extension for `futures` and `options` (#5742) * removed options and futures * add derivatives extension * cleanup * bug #5649 (#5722) * bug #5649 * fixing --a upmom, downmom --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Rename the fmp search -> screener (#5744) * Rename the fmp search -> screener * misses some * i cant copy paste * docs/fix-urls: Updates the Terminal About URLs to match `/develop` (#5720) * update Terminal about URLs and some other broken links * ruff * intro * changing the heading levels * dependency management sections * structure * developer guides * structure * contributor guides * keywords and descriptions * broken urls * cool cards * Cool cards (#5727) * tidy up terminal/content * some more tidy up * fix styling for platform that was missing * more tidy up * improve color for dark and light mode * create new reference card for more basic cards * rename back to menus * implement all index.md for terminal, except reference * improve bot title * more refactoring * fix remaining index * header styling * more styling * heheheheheheeh * Revert "heheheheheheeh" This reverts commit7d095fcfd2. * Ccards (#5733) * links * more links * improved styling and chevron aligned to title * fix index.mdx urls for Terminal * update package.json * update index.mdx * fix generation * spelling * toolkit_extensions * update data extensions * couple of links * add tiingo to data extensions list --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: James Maslek <jmaslek11@gmail.com> * Stock leftover cleanup (#5745) * change to equity in `.md` files * `HistoricalStockSplits`->`HistoricalSplits` * `StockInsiderTrading`->`InsiderTrading` * sorry fmp * `EquityHistorical` cleanup * `EquityNBBO` cleanup * .md leftover * the last of stocks * Hotfix/urllib to dev group (#5732) * use the urllib3 dependency on the dev group instead * adapt the version script for the nightlies - if it's a nightly the package distribution name will have a different name * add dev dependencies to the dev installation bc of the ci * updating the import on validate_call according to: https://docs.pydantic.dev/latest/concepts/validation_decorator/ the way we were importing it breaks if pydantic=2.5 @montezdesousa * loosing urllib3 version specification on the provider and adding it to platform dev deps * rmeoving urllib from top level deps; and removing --with dev flag * changing to ^ instead * Revert "changing to ^ instead" This reverts commit7300904e9f. * unnecessary dep --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> * feature/v4-bop - Add ECB Balance of Payments (Replaces #5716) (#5726) * add ecb balance of payments * missing __init__.py files * Nasdaq calendar earnings and fix FMP calendar earnings (#5718) Co-authored-by: James Maslek <jmaslek11@gmail.com> * feature/us-treasury-auctions: Adds Treasury Auctions endpoint and provider for US Government Data. (#5746) * add government_us provider and treasury auctions endpoint * black * add param for cusip * move logic for setting default start/end date * Update hub<>platform credentials map (#5749) * update hub<>platform credentials map * typo * Add API settings schema to system settings (#5743) Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * Skip checking creds (#5737) * skip checking creds * fix bug * ok mypy * add comment * rename required_credentials * fix * fix top_retail bug * don't require creds in some nasdaq fetchers * black * this was not here before * fix tests * update fetcher test * update contributing guidelines * Fix Quote (#5752) * Fix Quote * fixed return type and model validation --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Wrap up renaming global news to world news on a model level (#5750) * Wrap up renaming global news to world news on a model level * cleanup --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Remove eod from docstrings (#5751) * Wrap up renaming global news to world news on a model level * Remove "end of day" from historical price model docstrings --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Massive docstring cleanup (#5755) * sec router remove command * standard models cleanup * fmp cleanup * av cleanup * benzinga cleanup * biztoc cleanup * cboe cleanup * ecb cleanup * finra cleanup * fred cleanup * us cleanup * intrinio cleanup * nasdaq cleanup * oecd cleanup * polygon cleanup * sec cleanup * seeking alpha cleanup * stockgrid cleanup * tiingo cleanup * tradingeconomics cleanup * ultima cleanup * wsj cleanup * yfinance cleanup * sec router lint * fix date query param description * Updates system and api settings (#5753) * remove uncessary import on rest api * remove FrozenField and add api.version * allow setup from json * remove id tag * computed field is better * formatting --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Squeeze build time (#5756) * squeeze build time * bug fix * fix test * typo? * rebuild * keep tradingeconomics * docs/working-docs: Working V4 Docs PR (#5747) * post-install clarification, fix links * more links * change word * toolkit cleanup * rename 'contributing' to 'development' * update extensions * some urls * Update sdk-platform and v4-develop in urls (#5730) * Update sdk-platform and v4-develop in urls * Seprate Intrinio financials data tags into a different command (#5723) * add `ebit` field in income statement standard model * only add required data tags * remove calculations data * use `name` key instead of `tag` key * set `period` as required in data * remove `period` and `cik` from provider models * add `equity/fundamental/search_financial_attributes` with tests * clean descriptions file * add `equity/fundamental/financial_attributes` with tests * set `value` as `Optional` * Fix threadpool test error (#5734) * Remove ultima from deps (#5736) * remove ultima from deps * skip ultima test * black * change skip location * try except statement to avoid error on the ci * new currency reference rates pr (#5724) * point files to linters (#5739) * remove news from equity (#5741) * Add tiingo provider (#5740) * first commit * things * Add news endpoints * CryptoHistorical * Add currency and trailing dividend yield * things working * deps * fix pre commit things * tests? * black on the tests * pratty told me to add it * integration tests * added helpers * crypto revamped * currency revamped * trailing dividend yield revamped * equity historical revamped * company news overhauled * global news overhauled * remove `tags` param from news models * crypto correct `exchanges` description * james smh * re-recorded fetcher tests * fixed integration tests * econometrics smh * james smh again --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Add `derivatives` extension for `futures` and `options` (#5742) * removed options and futures * add derivatives extension * cleanup * bug #5649 (#5722) * bug #5649 * fixing --a upmom, downmom --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Rename the fmp search -> screener (#5744) * Rename the fmp search -> screener * misses some * i cant copy paste * docs/fix-urls: Updates the Terminal About URLs to match `/develop` (#5720) * update Terminal about URLs and some other broken links * ruff * intro * changing the heading levels * dependency management sections * structure * developer guides * structure * contributor guides * keywords and descriptions * broken urls * cool cards * Cool cards (#5727) * tidy up terminal/content * some more tidy up * fix styling for platform that was missing * more tidy up * improve color for dark and light mode * create new reference card for more basic cards * rename back to menus * implement all index.md for terminal, except reference * improve bot title * more refactoring * fix remaining index * header styling * more styling * heheheheheheeh * Revert "heheheheheheeh" This reverts commit7d095fcfd2. * Ccards (#5733) * links * more links * improved styling and chevron aligned to title * fix index.mdx urls for Terminal * update package.json * update index.mdx * fix generation * spelling * toolkit_extensions * update data extensions * couple of links * add tiingo to data extensions list --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: James Maslek <jmaslek11@gmail.com> * Stock leftover cleanup (#5745) * change to equity in `.md` files * `HistoricalStockSplits`->`HistoricalSplits` * `StockInsiderTrading`->`InsiderTrading` * sorry fmp * `EquityHistorical` cleanup * `EquityNBBO` cleanup * .md leftover * the last of stocks * post-install clarification, fix links * more links * change word * toolkit cleanup * rename 'contributing' to 'development' * Hotfix/urllib to dev group (#5732) * use the urllib3 dependency on the dev group instead * adapt the version script for the nightlies - if it's a nightly the package distribution name will have a different name * add dev dependencies to the dev installation bc of the ci * updating the import on validate_call according to: https://docs.pydantic.dev/latest/concepts/validation_decorator/ the way we were importing it breaks if pydantic=2.5 @montezdesousa * loosing urllib3 version specification on the provider and adding it to platform dev deps * rmeoving urllib from top level deps; and removing --with dev flag * changing to ^ instead * Revert "changing to ^ instead" This reverts commit7300904e9f. * unnecessary dep --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> * feature/v4-bop - Add ECB Balance of Payments (Replaces #5716) (#5726) * add ecb balance of payments * missing __init__.py files * Nasdaq calendar earnings and fix FMP calendar earnings (#5718) Co-authored-by: James Maslek <jmaslek11@gmail.com> * feature/us-treasury-auctions: Adds Treasury Auctions endpoint and provider for US Government Data. (#5746) * add government_us provider and treasury auctions endpoint * black * add param for cusip * move logic for setting default start/end date * Update hub<>platform credentials map (#5749) * update hub<>platform credentials map * typo * Add API settings schema to system settings (#5743) Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * Skip checking creds (#5737) * skip checking creds * fix bug * ok mypy * add comment * rename required_credentials * fix * fix top_retail bug * don't require creds in some nasdaq fetchers * black * this was not here before * fix tests * update fetcher test * update contributing guidelines * Fix Quote (#5752) * Fix Quote * fixed return type and model validation --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Wrap up renaming global news to world news on a model level (#5750) * Wrap up renaming global news to world news on a model level * cleanup --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * update extensions * some urls * Revert changes to v3 docs --------- Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Ramazan <guvencramazan@yandex.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> * POST request example * update post example * find symbols * market calendars * codespell * codespell ftw * improve main page light mode --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Ramazan <guvencramazan@yandex.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> * Add Pro videos to docs + fix CI (#5765) * add pro vids * Update gh-pages.yml * install v4 (#5766) * install v4 * add run on pr * this seems sus * thnx juan * flip * thnx juan * idk * Update index.js * Update Root.tsx * Update index.js * try again * fix front matter * fix description front matter * Revert "fix description front matter" This reverts commitcccc7b2469. * try to fix this mickey * fixed all that mickey @DidierRLopes broke * Update index.js * generate platform fix * black fix --------- Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: tehcoderer <me@tehcoderer.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Generate widgets library (#5767) * generate widgets library * Update gh-pages.yml * black * ruff fix * add index to widgets-library * linter * Add support for multiple ticker (#5770) Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Released this code (#5761) * updates after release * bump pytest-recorder * Revert "bump pytest-recorder" This reverts commit245f178a7e. * needs to be in dev group * rerecord yfinance tests * record in us --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Feature/fix platform unit test (#5772) * changed checkout ref * Testing * revert changes * Docs/fix doc generations (#5775) * few changes * Update get_search_results.md * updates * undo build * Update test_generate_docs.py * Update controller_doc_classes.py * Update params_controller.py * Update params_controller.py * Small fix (#5777) This file gets automatically generated * Rename session file (#5771) * rename session file * rename method * Update README.md * placed as note * revert readme change --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * fix github pages deployment (#5780) * small changes (#5781) * Merge provider and core into core (#5774) * small changes - moving provider inside the core * uptade readme * lint * remove old provider readme * leftovers * refactor website examples * ruff * fix nox * relock * fix fails_to_deliver headers * fix for tests that have renamed endpoints * fix discovery * removed test for renamed endpoint * fix broken syntax - test_search_financial_attributes * fix cash/income/balance * fix derivatives tests * fix etf tests * fix news tests * fix regulators * black * wrong test param * sort equity gainers/losers by percent * platform markdown generation import * Hotfix/fix int tests core merge (#5779) * removing tests on old endpoint * removing visualization on old endpoint * fixing equity tests * fixing examples * fix news tests * fix index test * example * add comments * example --------- Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * hotfix/fix-technical-output: Include Dates in Output (#5754) * fixes output to include dates * ichimoku * add trading_periods param to cones * add param to integration tests --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * Feature/platform async (#5763) * init * updates * Update helpers.py * tests * Update helpers.py * Update command_runner.py * Update helpers.py * deps * Update helpers.py * only check `async` if model is specified, revert `qa`, `ta`, and `econometrics` * merge issues * Update command_runner.py * remove typing and type: ignore * fix helpers typing * add aiohttp to core deps, remove from charting * remove @overload * ruff * import helper from source * helpers typing+pylint * black --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> * Feature/general fixes (#5786) * fix mypy * import helper from source * improve missing api key msg * fix * remove dynamic default * rename rest_api_settings file * add comment async/sync * fix bug * Revert "fix bug" This reverts commit7d9a0d2749. * fix bug * hotfix/yfinance-download: Fix Intraday Helper (#5785) * fix yfinance_download intraday helper * fix today getting cutoff --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * Update Pro documentation (#5784) * fix pro videos to latest ones * small fix * attempt border on pro * Update index.md * Update index.md * Update charting.md * Update homepage.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update index.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update advanced-search.md * Update copilot.md * pro images gradient * update images with border * Update news.md * Update news.md * add examples to platform v4 generation/ fixed data model ref titles * fix `data_reference_cards` sort by title * Merge branch 'docs/update-pro-videos' of https://github.com/OpenBB-finance/OpenBBTerminal into docs/update-pro-videos --------- Co-authored-by: tehcoderer <me@tehcoderer.com> * fix `\n` in field descriptions breaks markdown table (#5792) * New Intrinio Endpoints (#5789) * redefined CalendarDividend standard model * fix nasdaq calendar dividend model * removed Filings standard model * add DiscoveryFilings standard model * fix fmp calendar dividend and discovery filing models * add cik description in standard model utils * redefine CompanyFilings standard model * fix fmp company filings model * fix sec company filings model * remove regulators/sec/filings command * redefine InsiderTrading standard model * fix fmp insider trading model * redefine InstitutionalOwnership standard model * fix fmp institutional ownership model * redefine KeyMetrics standard model * fix fmp key metrics model * fix fmp market snapshots model * add attributes standard model and commands * redefine EquityInfo standard model * remove SearchFinancialAttributes standard model file * add new intrinio endpoints * linting * pass standard model description test * fix tests? w/@montezdesousa * pass fmp fetcher tests * re-record sec company filings test * pass intrinio fetcher tests * re-record intrinio insider trading test * index integration test * regulators integration test * equity integration test * fix same owner name in intrinio instituional ownership * re-record intrinio insider training * crypto price historical integration test reduce end_date * Fix hqm (#5796) * Feature/release b2 (#5799) * publish core and extensions * rebuild and force commit package changes * Remove tiingo, finra and wsj from extras --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Equity multiples add symbol data field (#5800) * add symbol data field * cleanup * remove limit param from standard model * remove limit from equity integration test * re-recrod fmp and intrinio fetcher tests * fix calendar split (#5804) * Add `symbols` field to standard model data (#5802) * add symbols field to standard model data * fix provider models * re-record polygon fetcher test * fix polygon query alias * re-record polygon fetcher * Hotfix/yfinance-adjusted: Fix for #5798 (#5803) * fix yfinance-adjusted * update test * don't need that transform query param piece * re-record test, etf_historical make adj_close not mandatory * yfinance caching.. * mock cookie and crumb? --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Feature/fred-releases: Adds some FRED functionality to the economy router. (#5793) * fred economic releases search * add FRED functions for series and searching. * codespell * ruff * data description. * replace two functions with one fred_search * rename standard model to fred_series * remove consolidated fred model * return series metadata as warning * recapture test * fill nan with None * small fix (#5810) * remove finra, wsj and goventment-us from built ins (#5806) * Add sector news standard model (#5795) * Add Sector News standard model * Fix test coverage test failing --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * replace provider error by openbb (#5812) * split -> splits in calendar router (#5814) * Add Historical Dividends to Intrinio inplace of Calendar Dividends (#5813) * HistoricalDividends re-defined * re-define fmp model * add intrinio model * re-record intrinio test * fix integration tests --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Fix typos (#5808) * fix typo * fix typos * fix typo * fix typos * fix typos * fix typos * fix typo --------- Co-authored-by: Luqman <luqazino@gmail.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * warn loading error by default (#5818) * hotfix/fmp-insider-trading - Fix FMP Insider Trading (#5817) * fix fmp insider trading * re-capture tests * fix intrinio test * Fix nasdaq top retail working without a key resulting in an error (#5811) * raise error if no api key found * check for empty strings * black * fix test * less verbose --------- Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * hotfix/fmp-replace-zero: Replace Zero with None in FMP Balance, Cash, Income (#5815) * replace zeros with None in Balance, Cash, Income * black --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Set `level` as default `tag` value for `index.market` in Intrinio (#5801) * set level as default tag value * set limit to 1000 * re-record fetcher test --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Fix tests (#5819) * fix equity tests - python * remove test for intrinio * remove index.fred and fix tests w/@hjoaquim,@IgorWounds * fix ultima company news model w/@hjoaquim,@IgorWounds * re-record intrinio insider trading w/@hjoaquim,@IgorWounds * adjust endpoint * adjust endpoint * adjust params * fix equity test w/@IgorWounds * re-record * remove ultima test * adding keys to the workflow * typo --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * debuggint int tests (#5823) * debug * debug2 * extra debug step * Another hail mary * add debug * MMMMMbop * didnt import base64 * Other tests with headers * increase timeout to 20 --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Standardize balance, income, cash for Intrinio (#5809) * Fix test coverage test failing * Fix spot rates integration test * Apply the standardization to intrinio balance, income and cash --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/pro new widgets struct (#5805) * Improve widgets library structure * add styling to widgets library images * black linting * update widgets library index generator * update border of docs image * shift grouping Minh suggestion * no ruff in this file * Update chart-from-raw-data.md * lint * add pro to index docs * add workflows to docs * dunno how to spell existent lol * navbar logo to go to root docs * push missing bg * backend for terminal pro repo - Andrew suggestion * update content slightly * no widgets-library content should be pushed, this is generated at runtime * add Rita's vidos + review everything * Feature/release rc0 (#5821) * publish core and extensions * build static * lock openbb * force commit package changes --------- Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Account commands: add option to return user settings (#5825) * Add verbosity to login * Fix tests * Add verbosity for other * pratty=False * docstring --------- Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> * fix: search button? (#5831) * Revamp `openbb-core` README (#5830) * core readme * mentioning query params * fix: second attempt (#5832) * Move pytest dependencies from openbb level to to core dev deps level (#5829) * Move pytest to core dev deps * removing openbb-core from devtools * Fix dev_install script not picking developer dependencies --------- Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> * Prevent gh-actions from publishing v3 unless explicitly asked to (#5835) * Prevent gh-actions from publishing v3 unless explicitly asked to * ) says: "Wait for meeeeeee!" * Update branch name regex * Revert release-v3 changes * updating to pick up the core folder instead (platform folder was droped) (#5836) * Hotfix/test fix (#5827) * Add verbosity to login * Fix tests * fix dem tests baby --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Release/4.0.0 (#5837) * pyproject toml and poetry.lock files * static assets * fix link to platform * bump core * 4.0.1 adjustments * Fix merge conflict artifacts in the docs * Sync docs with develop * Sync docs generation with develop * docs/new-working-docs: New working docs branch (#5768) * move old example notebooks to v3 folder, update loadHistoricalPriceData and add findSymbols * Create README.md * Update README.md * Update README.md * Update README.md * Vertical diagram instead * important classes * core dependencies * folder structure * devtools * swap order * fix github pages deploy issue * development index * delete expectations for developers * devtools * obbject stuff * add * installation * hub sync * idk if i committed already * add usage page for financial statements * add link to reference page * syntax * numbers * nearly --> more than * easier to read code blocks * codespell * removing mention to provider * add 'orientation' for to_dict * info card for output user preference * put it in a code block * correct user_settings.json example * syntax corrections * fix sentence * get rid of floating point mathc * get rid of other floating point math * add companion example notebook for financial statements, and new section * historical prices usage page * codespell * add commitment of traders section to usage * add a note * codespell * get rid of equals sign * Cleanup docs. with @the-praxs * install * obbject extend * spell * HeadTitle thingies * Update obbject_extensions.md * Update obbject_extensions.md * typo * Update architectural_considerations.md * point to the TET pattern * optional vs required * reviewing the patterns. removed the --pre flag under the assumption this will be the final docs for the release cc @deeleeramone * add a walkthrough * spelling * Add more in the introduction * validator examples * update Copper-to-Gold notebook example for V4 * Update README.md * QA Caveats w @the-praxs * info on class outputs * merge add data sources and add data points * disclaimer on cookiecutter * add missing import to example * slight syntax change * missing code block * missing import * update intrinio example syntax * intrinio syntax update * urls * core and provider merged * example syntax * grammar * Update API banner link * quick-fix-docs cc @minhhoang1023 * Update pip install command for v3 * remove --pre note block * update landing image --------- Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Luqman <luqazino@gmail.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * fix docs (#5847) * Small change in extensions doc (#5844) * break one table into 2 * Edit pypi readme * remove extra ``` --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Google Colab Install Notebook (#5841) * Google Colab Install Notebook Adds example notebook for Google Colab install. * Update README.md * Update README.md Add badge -- won't work until merged into develop * point to develop for nb --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Sync merge with main (#5838) * Release/3.2.4 (#5696) * test * ultima description (#5541) * Updating showcase page (#5543) * updating showcase page * use sdk instead * add new bot command autopost docs (#5530) add new bot command autopost docs to docs.openbb.co Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/ultima improvements (#5553) * tweaks for monetization * fix linting issue * fix: Modify 'load' behavior to append data to existing sheet (#5503) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Fixed 'worksheet not found' error during export to an existing sheet * Changes: * Now if the sheet exists in the xlsx file it will ask the user if he wants to replace/append/create new sheet --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * added platform API integration test to Nightly build (#5571) * Add columns to `stocks/search` (#5565) * Add columns to `stocks/search` isin, cusip, figi, composite_figi, shareclass_figi * Update test_search[False].txt * Update test_search[True].txt * Delete tests/openbb_terminal/stocks/cassettes/test_stocks_helper/test_search.yaml * Create test_search.yaml --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * updating ultima urls (#5587) * fix: A value is trying to be set on a copy of a slice from a DataFrame #5582 (#5591) * Update README.md (#5598) * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * fix docs (#5646) * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update settings.md (#5665) * fix front matter (#5667) * #5633 adding comma every 1000 (#5652) * #5633 adding comma every 1000 * pylint --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Hotfix/reports model render report sanitize inputs (#5669) * Adding more robust special character handling to create_output_path().Addresses https://github.com/OpenBB-finance/OpenBBTerminal/issues/5299 * Running black linter on code to conform to OBB style guides. --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * hotfix/fix-gov-histcont: Fix #5650 - /stocks/gov/histcont (#5676) * fix histcont * some cleanup * remove sort line * 12-31 not 12-12 * columns_keep_types * remove space in regex (#5675) * Pin openai (#5685) * Clarified stocks/ta empty recom object message (#5468) * Clarified stocks/ta empty recom object message * black * lint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * improved market cap value extraction (#5169) * improved market cap value extraction * pylint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * 3.2.3->3.2.4 * Changelogs * new changelog --------- Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Andrew <andrew.kenreich@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Luqman <luqazino@gmail.com> Co-authored-by: Adwait <111136306+AdwaitSalankar@users.noreply.github.com> Co-authored-by: Abhishek Amar <66067391+abhishek-amar@users.noreply.github.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Ramazan <guvencramazan@outlook.com> Co-authored-by: joshuabuildsthings <joshuabuildsthings@users.noreply.github.com> Co-authored-by: wojda <114031148+polooner@users.noreply.github.com> Co-authored-by: Bim Phomthong <118195204+bimbolimbo@users.noreply.github.com> * Fix merge conflict artifacts in the docs * Sync docs with develop * Sync docs generation with develop * Update labels-PR check --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Andrew <andrew.kenreich@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Luqman <luqazino@gmail.com> Co-authored-by: Adwait <111136306+AdwaitSalankar@users.noreply.github.com> Co-authored-by: Abhishek Amar <66067391+abhishek-amar@users.noreply.github.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Ramazan <guvencramazan@outlook.com> Co-authored-by: joshuabuildsthings <joshuabuildsthings@users.noreply.github.com> Co-authored-by: wojda <114031148+polooner@users.noreply.github.com> Co-authored-by: Bim Phomthong <118195204+bimbolimbo@users.noreply.github.com> --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Andrew <andrew.kenreich@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Luqman <luqazino@gmail.com> Co-authored-by: Adwait <111136306+AdwaitSalankar@users.noreply.github.com> Co-authored-by: Abhishek Amar <66067391+abhishek-amar@users.noreply.github.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Ramazan <guvencramazan@outlook.com> Co-authored-by: joshuabuildsthings <joshuabuildsthings@users.noreply.github.com> Co-authored-by: wojda <114031148+polooner@users.noreply.github.com> Co-authored-by: Bim Phomthong <118195204+bimbolimbo@users.noreply.github.com> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: tehcoderer <me@tehcoderer.com> Co-authored-by: Ramazan <guvencramazan@yandex.com> Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
2125 lines
106 KiB
Plaintext
Vendored
2125 lines
106 KiB
Plaintext
Vendored
{
|
||
"nbformat": 4,
|
||
"nbformat_minor": 0,
|
||
"metadata": {
|
||
"colab": {
|
||
"provenance": []
|
||
},
|
||
"kernelspec": {
|
||
"name": "python3",
|
||
"display_name": "Python 3"
|
||
},
|
||
"language_info": {
|
||
"name": "python"
|
||
},
|
||
"widgets": {
|
||
"application/vnd.jupyter.widget-state+json": {
|
||
"fc6a4747cea243f4bac6a19c43264fec": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "DropdownModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "DropdownModel",
|
||
"_options_labels": [
|
||
"Total Open Interest",
|
||
"Call Open Interest",
|
||
"Put Open Interest",
|
||
"Total Volume",
|
||
"Call Volume",
|
||
"Put Volume"
|
||
],
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "DropdownView",
|
||
"description": "",
|
||
"description_tooltip": null,
|
||
"disabled": false,
|
||
"index": 0,
|
||
"layout": "IPY_MODEL_bf10b4a3831f4e6595398f2d62a0f7b2",
|
||
"style": "IPY_MODEL_6095af63918f4075a891fc950c9790d3"
|
||
}
|
||
},
|
||
"bf10b4a3831f4e6595398f2d62a0f7b2": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"6095af63918f4075a891fc950c9790d3": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "DescriptionStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "DescriptionStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"description_width": ""
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"cells": [
|
||
{
|
||
"cell_type": "markdown",
|
||
"source": [
|
||
"# Installing the OpenBB Platform in Google Colab\n",
|
||
"\n",
|
||
"This notebook will install the OpenBB Platform, fetch some data and prepare it for display as a bar chart.\n",
|
||
"\n",
|
||
"Sign up for a free account here: https://my.openbb.co"
|
||
],
|
||
"metadata": {
|
||
"id": "xIOXTKkqBReO"
|
||
}
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {
|
||
"id": "xvU65bhqKNns"
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"# Install the OpenBB Platform with all available extensions.\n",
|
||
"# Messages indicating package version conflicts at the end of installation can be safely ignored.\n",
|
||
"\n",
|
||
"!pip install openbb[all]\n",
|
||
"\n",
|
||
"# There is also a nightly distribution available, openbb-nightly"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"# Before running this cell, restart the runtime by selecting, \"Restart runtime\", from the \"Runtime\" menu.\n",
|
||
"\n",
|
||
"# Import statements - for many scenarios, the only import needed will be `from openbb import obb`\n",
|
||
"from typing import Literal\n",
|
||
"from IPython.display import display\n",
|
||
"from IPython.display import clear_output\n",
|
||
"import ipywidgets as widgets\n",
|
||
"import pandas as pd\n",
|
||
"import pandas_ta as ta\n",
|
||
"from datetime import datetime\n",
|
||
"from plotly import graph_objects as go\n",
|
||
"\n",
|
||
"from openbb import obb"
|
||
],
|
||
"metadata": {
|
||
"id": "_69FIu9YKRhI"
|
||
},
|
||
"execution_count": 98,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"# Login to OpenBB Hub to retrieve stored API keys.\n",
|
||
"# https://my.openbb.co/app/platform/pat\n",
|
||
"# https://my.openbb.co/app/platform/api-keys\n",
|
||
"\n",
|
||
"obb.account.login(pat=\"replace with your PAT\")\n",
|
||
"\n",
|
||
"# This is not required"
|
||
],
|
||
"metadata": {
|
||
"id": "1OLsZHDYMBSS"
|
||
},
|
||
"execution_count": 3,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"# Verify that the credentials from Hub were loaded successfully.\n",
|
||
"\n",
|
||
"obb.user.credentials"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "gJ7FwTC6MTzv",
|
||
"outputId": "b9d4e888-7f3f-4756-b1a4-ae438e61c2b5"
|
||
},
|
||
"execution_count": 4,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"Credentials\n",
|
||
"\n",
|
||
"alpha_vantage_api_key: **********\n",
|
||
"benzinga_api_key: None\n",
|
||
"biztoc_api_key: None\n",
|
||
"fmp_api_key: **********\n",
|
||
"fred_api_key: **********\n",
|
||
"intrinio_api_key: **********\n",
|
||
"nasdaq_api_key: **********\n",
|
||
"polygon_api_key: **********\n",
|
||
"tiingo_token: None\n",
|
||
"tradingeconomics_api_key: None"
|
||
]
|
||
},
|
||
"metadata": {},
|
||
"execution_count": 4
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"# Set the output preference, if desired. The examples below use Pandas DataFrames.\n",
|
||
"\n",
|
||
"obb.user.preferences.output_type = \"dataframe\""
|
||
],
|
||
"metadata": {
|
||
"id": "27JtqRAQ2HTb"
|
||
},
|
||
"execution_count": 67,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"# Get Some Data\n",
|
||
"symbol = \"SPY\"\n",
|
||
"\n",
|
||
"options = obb.derivatives.options.chains(symbol, provider=\"cboe\")\n",
|
||
"\n",
|
||
"options"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 444
|
||
},
|
||
"id": "GWI_60zD3M3l",
|
||
"outputId": "47338fab-8ab5-467f-c26e-44148c848c63"
|
||
},
|
||
"execution_count": 88,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
" contract_symbol expiration strike option_type volume open \\\n",
|
||
"0 SPY231130C00387000 2023-11-30 387.0 call 7.0 67.60 \n",
|
||
"1 SPY231130P00387000 2023-11-30 387.0 put 2.0 0.01 \n",
|
||
"2 SPY231130C00388000 2023-11-30 388.0 call 1.0 66.47 \n",
|
||
"3 SPY231130P00388000 2023-11-30 388.0 put 1.0 0.01 \n",
|
||
"4 SPY231130C00389000 2023-11-30 389.0 call 0.0 0.00 \n",
|
||
"... ... ... ... ... ... ... \n",
|
||
"8215 SPY260116P00670000 2026-01-16 670.0 put 0.0 0.00 \n",
|
||
"8216 SPY260116C00675000 2026-01-16 675.0 call 0.0 0.00 \n",
|
||
"8217 SPY260116P00675000 2026-01-16 675.0 put 0.0 0.00 \n",
|
||
"8218 SPY260116C00680000 2026-01-16 680.0 call 0.0 0.00 \n",
|
||
"8219 SPY260116P00680000 2026-01-16 680.0 put 0.0 0.00 \n",
|
||
"\n",
|
||
" open_interest high low implied_volatility ... last_trade_price \\\n",
|
||
"0 5.0 67.60 66.55 0.0000 ... 66.55 \n",
|
||
"1 290.0 0.01 0.01 0.0000 ... 0.01 \n",
|
||
"2 0.0 66.47 66.47 0.0000 ... 66.47 \n",
|
||
"3 1.0 0.01 0.01 0.0000 ... 0.01 \n",
|
||
"4 0.0 0.00 0.00 0.0000 ... 0.00 \n",
|
||
"... ... ... ... ... ... ... \n",
|
||
"8215 0.0 0.00 0.00 0.2367 ... 216.04 \n",
|
||
"8216 0.0 0.00 0.00 0.1387 ... 0.00 \n",
|
||
"8217 0.0 0.00 0.00 0.2385 ... 0.00 \n",
|
||
"8218 0.0 0.00 0.00 0.1411 ... 0.00 \n",
|
||
"8219 0.0 0.00 0.00 0.2432 ... 223.91 \n",
|
||
"\n",
|
||
" tick prev_close change change_percent rho \\\n",
|
||
"0 down 67.69 -1.135 -1.68 0.0003 \n",
|
||
"1 no_change 0.00 0.005 100.00 0.0000 \n",
|
||
"2 down 66.68 -0.210 -0.31 0.0003 \n",
|
||
"3 no_change 0.00 0.005 100.00 0.0000 \n",
|
||
"4 no_change 65.69 0.000 0.00 0.0003 \n",
|
||
"... ... ... ... ... ... \n",
|
||
"8215 down 215.44 0.000 0.00 -0.3427 \n",
|
||
"8216 no_change 2.50 0.000 0.00 0.4385 \n",
|
||
"8217 no_change 220.50 0.000 0.00 -0.3453 \n",
|
||
"8218 no_change 2.50 0.000 0.00 0.4078 \n",
|
||
"8219 down 225.50 0.000 0.00 -0.3478 \n",
|
||
"\n",
|
||
" last_trade_timestamp dte bid ask \n",
|
||
"0 2023-11-30 12:27:59 -1 67.77 70.67 \n",
|
||
"1 2023-11-30 09:30:12 -1 0.00 0.01 \n",
|
||
"2 2023-11-30 09:42:00 -1 67.56 68.77 \n",
|
||
"3 2023-11-30 10:16:04 -1 0.00 0.01 \n",
|
||
"4 NaT -1 65.77 68.67 \n",
|
||
"... ... ... ... ... \n",
|
||
"8215 2023-11-20 12:31:47 777 211.56 216.50 \n",
|
||
"8216 NaT 777 0.00 5.00 \n",
|
||
"8217 NaT 777 216.50 221.50 \n",
|
||
"8218 NaT 777 0.00 5.00 \n",
|
||
"8219 2023-11-27 14:07:53 777 221.50 226.50 \n",
|
||
"\n",
|
||
"[8220 rows x 27 columns]"
|
||
],
|
||
"text/html": [
|
||
"\n",
|
||
" <div id=\"df-2a8d8e0e-044c-4e66-bd79-582b5ef51f80\" class=\"colab-df-container\">\n",
|
||
" <div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>contract_symbol</th>\n",
|
||
" <th>expiration</th>\n",
|
||
" <th>strike</th>\n",
|
||
" <th>option_type</th>\n",
|
||
" <th>volume</th>\n",
|
||
" <th>open</th>\n",
|
||
" <th>open_interest</th>\n",
|
||
" <th>high</th>\n",
|
||
" <th>low</th>\n",
|
||
" <th>implied_volatility</th>\n",
|
||
" <th>...</th>\n",
|
||
" <th>last_trade_price</th>\n",
|
||
" <th>tick</th>\n",
|
||
" <th>prev_close</th>\n",
|
||
" <th>change</th>\n",
|
||
" <th>change_percent</th>\n",
|
||
" <th>rho</th>\n",
|
||
" <th>last_trade_timestamp</th>\n",
|
||
" <th>dte</th>\n",
|
||
" <th>bid</th>\n",
|
||
" <th>ask</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>SPY231130C00387000</td>\n",
|
||
" <td>2023-11-30</td>\n",
|
||
" <td>387.0</td>\n",
|
||
" <td>call</td>\n",
|
||
" <td>7.0</td>\n",
|
||
" <td>67.60</td>\n",
|
||
" <td>5.0</td>\n",
|
||
" <td>67.60</td>\n",
|
||
" <td>66.55</td>\n",
|
||
" <td>0.0000</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>66.55</td>\n",
|
||
" <td>down</td>\n",
|
||
" <td>67.69</td>\n",
|
||
" <td>-1.135</td>\n",
|
||
" <td>-1.68</td>\n",
|
||
" <td>0.0003</td>\n",
|
||
" <td>2023-11-30 12:27:59</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>67.77</td>\n",
|
||
" <td>70.67</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>SPY231130P00387000</td>\n",
|
||
" <td>2023-11-30</td>\n",
|
||
" <td>387.0</td>\n",
|
||
" <td>put</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>0.01</td>\n",
|
||
" <td>290.0</td>\n",
|
||
" <td>0.01</td>\n",
|
||
" <td>0.01</td>\n",
|
||
" <td>0.0000</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.01</td>\n",
|
||
" <td>no_change</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.005</td>\n",
|
||
" <td>100.00</td>\n",
|
||
" <td>0.0000</td>\n",
|
||
" <td>2023-11-30 09:30:12</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.01</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>SPY231130C00388000</td>\n",
|
||
" <td>2023-11-30</td>\n",
|
||
" <td>388.0</td>\n",
|
||
" <td>call</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>66.47</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>66.47</td>\n",
|
||
" <td>66.47</td>\n",
|
||
" <td>0.0000</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>66.47</td>\n",
|
||
" <td>down</td>\n",
|
||
" <td>66.68</td>\n",
|
||
" <td>-0.210</td>\n",
|
||
" <td>-0.31</td>\n",
|
||
" <td>0.0003</td>\n",
|
||
" <td>2023-11-30 09:42:00</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>67.56</td>\n",
|
||
" <td>68.77</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>SPY231130P00388000</td>\n",
|
||
" <td>2023-11-30</td>\n",
|
||
" <td>388.0</td>\n",
|
||
" <td>put</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>0.01</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>0.01</td>\n",
|
||
" <td>0.01</td>\n",
|
||
" <td>0.0000</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.01</td>\n",
|
||
" <td>no_change</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.005</td>\n",
|
||
" <td>100.00</td>\n",
|
||
" <td>0.0000</td>\n",
|
||
" <td>2023-11-30 10:16:04</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.01</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>SPY231130C00389000</td>\n",
|
||
" <td>2023-11-30</td>\n",
|
||
" <td>389.0</td>\n",
|
||
" <td>call</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.0000</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>no_change</td>\n",
|
||
" <td>65.69</td>\n",
|
||
" <td>0.000</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.0003</td>\n",
|
||
" <td>NaT</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>65.77</td>\n",
|
||
" <td>68.67</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>...</th>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>8215</th>\n",
|
||
" <td>SPY260116P00670000</td>\n",
|
||
" <td>2026-01-16</td>\n",
|
||
" <td>670.0</td>\n",
|
||
" <td>put</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.2367</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>216.04</td>\n",
|
||
" <td>down</td>\n",
|
||
" <td>215.44</td>\n",
|
||
" <td>0.000</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>-0.3427</td>\n",
|
||
" <td>2023-11-20 12:31:47</td>\n",
|
||
" <td>777</td>\n",
|
||
" <td>211.56</td>\n",
|
||
" <td>216.50</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>8216</th>\n",
|
||
" <td>SPY260116C00675000</td>\n",
|
||
" <td>2026-01-16</td>\n",
|
||
" <td>675.0</td>\n",
|
||
" <td>call</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.1387</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>no_change</td>\n",
|
||
" <td>2.50</td>\n",
|
||
" <td>0.000</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.4385</td>\n",
|
||
" <td>NaT</td>\n",
|
||
" <td>777</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>5.00</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>8217</th>\n",
|
||
" <td>SPY260116P00675000</td>\n",
|
||
" <td>2026-01-16</td>\n",
|
||
" <td>675.0</td>\n",
|
||
" <td>put</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.2385</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>no_change</td>\n",
|
||
" <td>220.50</td>\n",
|
||
" <td>0.000</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>-0.3453</td>\n",
|
||
" <td>NaT</td>\n",
|
||
" <td>777</td>\n",
|
||
" <td>216.50</td>\n",
|
||
" <td>221.50</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>8218</th>\n",
|
||
" <td>SPY260116C00680000</td>\n",
|
||
" <td>2026-01-16</td>\n",
|
||
" <td>680.0</td>\n",
|
||
" <td>call</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.1411</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>no_change</td>\n",
|
||
" <td>2.50</td>\n",
|
||
" <td>0.000</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.4078</td>\n",
|
||
" <td>NaT</td>\n",
|
||
" <td>777</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>5.00</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>8219</th>\n",
|
||
" <td>SPY260116P00680000</td>\n",
|
||
" <td>2026-01-16</td>\n",
|
||
" <td>680.0</td>\n",
|
||
" <td>put</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>0.2432</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>223.91</td>\n",
|
||
" <td>down</td>\n",
|
||
" <td>225.50</td>\n",
|
||
" <td>0.000</td>\n",
|
||
" <td>0.00</td>\n",
|
||
" <td>-0.3478</td>\n",
|
||
" <td>2023-11-27 14:07:53</td>\n",
|
||
" <td>777</td>\n",
|
||
" <td>221.50</td>\n",
|
||
" <td>226.50</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>8220 rows × 27 columns</p>\n",
|
||
"</div>\n",
|
||
" <div class=\"colab-df-buttons\">\n",
|
||
"\n",
|
||
" <div class=\"colab-df-container\">\n",
|
||
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-2a8d8e0e-044c-4e66-bd79-582b5ef51f80')\"\n",
|
||
" title=\"Convert this dataframe to an interactive table.\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
|
||
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
|
||
" </svg>\n",
|
||
" </button>\n",
|
||
"\n",
|
||
" <style>\n",
|
||
" .colab-df-container {\n",
|
||
" display:flex;\n",
|
||
" gap: 12px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert {\n",
|
||
" background-color: #E8F0FE;\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: #1967D2;\n",
|
||
" height: 32px;\n",
|
||
" padding: 0 0 0 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert:hover {\n",
|
||
" background-color: #E2EBFA;\n",
|
||
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: #174EA6;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-buttons div {\n",
|
||
" margin-bottom: 4px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert {\n",
|
||
" background-color: #3B4455;\n",
|
||
" fill: #D2E3FC;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert:hover {\n",
|
||
" background-color: #434B5C;\n",
|
||
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
||
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
||
" fill: #FFFFFF;\n",
|
||
" }\n",
|
||
" </style>\n",
|
||
"\n",
|
||
" <script>\n",
|
||
" const buttonEl =\n",
|
||
" document.querySelector('#df-2a8d8e0e-044c-4e66-bd79-582b5ef51f80 button.colab-df-convert');\n",
|
||
" buttonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
"\n",
|
||
" async function convertToInteractive(key) {\n",
|
||
" const element = document.querySelector('#df-2a8d8e0e-044c-4e66-bd79-582b5ef51f80');\n",
|
||
" const dataTable =\n",
|
||
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
|
||
" [key], {});\n",
|
||
" if (!dataTable) return;\n",
|
||
"\n",
|
||
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
|
||
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
|
||
" + ' to learn more about interactive tables.';\n",
|
||
" element.innerHTML = '';\n",
|
||
" dataTable['output_type'] = 'display_data';\n",
|
||
" await google.colab.output.renderOutput(dataTable, element);\n",
|
||
" const docLink = document.createElement('div');\n",
|
||
" docLink.innerHTML = docLinkHtml;\n",
|
||
" element.appendChild(docLink);\n",
|
||
" }\n",
|
||
" </script>\n",
|
||
" </div>\n",
|
||
"\n",
|
||
"\n",
|
||
"<div id=\"df-9fe9272b-1929-45e6-bb98-bf3f44b552b7\">\n",
|
||
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-9fe9272b-1929-45e6-bb98-bf3f44b552b7')\"\n",
|
||
" title=\"Suggest charts\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
|
||
" width=\"24px\">\n",
|
||
" <g>\n",
|
||
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
|
||
" </g>\n",
|
||
"</svg>\n",
|
||
" </button>\n",
|
||
"\n",
|
||
"<style>\n",
|
||
" .colab-df-quickchart {\n",
|
||
" --bg-color: #E8F0FE;\n",
|
||
" --fill-color: #1967D2;\n",
|
||
" --hover-bg-color: #E2EBFA;\n",
|
||
" --hover-fill-color: #174EA6;\n",
|
||
" --disabled-fill-color: #AAA;\n",
|
||
" --disabled-bg-color: #DDD;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-quickchart {\n",
|
||
" --bg-color: #3B4455;\n",
|
||
" --fill-color: #D2E3FC;\n",
|
||
" --hover-bg-color: #434B5C;\n",
|
||
" --hover-fill-color: #FFFFFF;\n",
|
||
" --disabled-bg-color: #3B4455;\n",
|
||
" --disabled-fill-color: #666;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-quickchart {\n",
|
||
" background-color: var(--bg-color);\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: var(--fill-color);\n",
|
||
" height: 32px;\n",
|
||
" padding: 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-quickchart:hover {\n",
|
||
" background-color: var(--hover-bg-color);\n",
|
||
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: var(--button-hover-fill-color);\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-quickchart-complete:disabled,\n",
|
||
" .colab-df-quickchart-complete:disabled:hover {\n",
|
||
" background-color: var(--disabled-bg-color);\n",
|
||
" fill: var(--disabled-fill-color);\n",
|
||
" box-shadow: none;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-spinner {\n",
|
||
" border: 2px solid var(--fill-color);\n",
|
||
" border-color: transparent;\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" animation:\n",
|
||
" spin 1s steps(1) infinite;\n",
|
||
" }\n",
|
||
"\n",
|
||
" @keyframes spin {\n",
|
||
" 0% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" border-left-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 20% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-left-color: var(--fill-color);\n",
|
||
" border-top-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 30% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-left-color: var(--fill-color);\n",
|
||
" border-top-color: var(--fill-color);\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 40% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" border-top-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 60% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 80% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 90% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"\n",
|
||
" <script>\n",
|
||
" async function quickchart(key) {\n",
|
||
" const quickchartButtonEl =\n",
|
||
" document.querySelector('#' + key + ' button');\n",
|
||
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
|
||
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
|
||
" try {\n",
|
||
" const charts = await google.colab.kernel.invokeFunction(\n",
|
||
" 'suggestCharts', [key], {});\n",
|
||
" } catch (error) {\n",
|
||
" console.error('Error during call to suggestCharts:', error);\n",
|
||
" }\n",
|
||
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
|
||
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
|
||
" }\n",
|
||
" (() => {\n",
|
||
" let quickchartButtonEl =\n",
|
||
" document.querySelector('#df-9fe9272b-1929-45e6-bb98-bf3f44b552b7 button');\n",
|
||
" quickchartButtonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
" })();\n",
|
||
" </script>\n",
|
||
"</div>\n",
|
||
" </div>\n",
|
||
" </div>\n"
|
||
]
|
||
},
|
||
"metadata": {},
|
||
"execution_count": 88
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"# Prepare A View - Volume and Open Interest by Expiration or Strike\n",
|
||
"\n",
|
||
"def filter_options_data(options, by: Literal[\"expiration\", \"strike\"] = \"expiration\"):\n",
|
||
" data = pd.DataFrame()\n",
|
||
" data[\"Total Open Interest\"] = options.groupby(by)[\"open_interest\"].sum()\n",
|
||
" data[\"Call Open Interest\"] = options[options[\"option_type\"] == \"call\"].groupby(by)[\"open_interest\"].sum()\n",
|
||
" data[\"Put Open Interest\"] = options[options[\"option_type\"] == \"put\"].groupby(by)[\"open_interest\"].sum()\n",
|
||
" data[\"Total Volume\"] = options.groupby(by)[\"volume\"].sum()\n",
|
||
" data[\"Call Volume\"] = options[options[\"option_type\"] == \"call\"].groupby(by)[\"volume\"].sum()\n",
|
||
" data[\"Put Volume\"] = options[options[\"option_type\"] == \"put\"].groupby(by)[\"volume\"].sum()\n",
|
||
"\n",
|
||
" return data\n",
|
||
"\n",
|
||
"data = filter_options_data(options, \"strike\")\n",
|
||
"\n",
|
||
"data"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 455
|
||
},
|
||
"id": "F-SpeJUi3l1k",
|
||
"outputId": "ee703998-297f-4831-8aad-422e16a5b3eb"
|
||
},
|
||
"execution_count": 101,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
" Total Open Interest Call Open Interest Put Open Interest \\\n",
|
||
"strike \n",
|
||
"120.0 22821.0 74.0 22747.0 \n",
|
||
"130.0 1506.0 19.0 1487.0 \n",
|
||
"140.0 488.0 2.0 486.0 \n",
|
||
"150.0 72684.0 2072.0 70612.0 \n",
|
||
"155.0 12298.0 18.0 12280.0 \n",
|
||
"... ... ... ... \n",
|
||
"700.0 24945.0 24835.0 110.0 \n",
|
||
"705.0 478.0 478.0 0.0 \n",
|
||
"710.0 1511.0 1511.0 0.0 \n",
|
||
"715.0 981.0 981.0 0.0 \n",
|
||
"720.0 102823.0 102821.0 2.0 \n",
|
||
"\n",
|
||
" Total Volume Call Volume Put Volume \n",
|
||
"strike \n",
|
||
"120.0 78.0 0.0 78.0 \n",
|
||
"130.0 61.0 0.0 61.0 \n",
|
||
"140.0 1.0 0.0 1.0 \n",
|
||
"150.0 65.0 4.0 61.0 \n",
|
||
"155.0 21.0 1.0 20.0 \n",
|
||
"... ... ... ... \n",
|
||
"700.0 2.0 2.0 0.0 \n",
|
||
"705.0 0.0 0.0 0.0 \n",
|
||
"710.0 3.0 1.0 2.0 \n",
|
||
"715.0 0.0 0.0 0.0 \n",
|
||
"720.0 36.0 36.0 0.0 \n",
|
||
"\n",
|
||
"[272 rows x 6 columns]"
|
||
],
|
||
"text/html": [
|
||
"\n",
|
||
" <div id=\"df-02f2b63a-6a85-4d2c-b3bf-21981cfe56e6\" class=\"colab-df-container\">\n",
|
||
" <div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>Total Open Interest</th>\n",
|
||
" <th>Call Open Interest</th>\n",
|
||
" <th>Put Open Interest</th>\n",
|
||
" <th>Total Volume</th>\n",
|
||
" <th>Call Volume</th>\n",
|
||
" <th>Put Volume</th>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>strike</th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>120.0</th>\n",
|
||
" <td>22821.0</td>\n",
|
||
" <td>74.0</td>\n",
|
||
" <td>22747.0</td>\n",
|
||
" <td>78.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>78.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>130.0</th>\n",
|
||
" <td>1506.0</td>\n",
|
||
" <td>19.0</td>\n",
|
||
" <td>1487.0</td>\n",
|
||
" <td>61.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>61.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>140.0</th>\n",
|
||
" <td>488.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>486.0</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>150.0</th>\n",
|
||
" <td>72684.0</td>\n",
|
||
" <td>2072.0</td>\n",
|
||
" <td>70612.0</td>\n",
|
||
" <td>65.0</td>\n",
|
||
" <td>4.0</td>\n",
|
||
" <td>61.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>155.0</th>\n",
|
||
" <td>12298.0</td>\n",
|
||
" <td>18.0</td>\n",
|
||
" <td>12280.0</td>\n",
|
||
" <td>21.0</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>20.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>...</th>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>700.0</th>\n",
|
||
" <td>24945.0</td>\n",
|
||
" <td>24835.0</td>\n",
|
||
" <td>110.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>705.0</th>\n",
|
||
" <td>478.0</td>\n",
|
||
" <td>478.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>710.0</th>\n",
|
||
" <td>1511.0</td>\n",
|
||
" <td>1511.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>3.0</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>715.0</th>\n",
|
||
" <td>981.0</td>\n",
|
||
" <td>981.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>720.0</th>\n",
|
||
" <td>102823.0</td>\n",
|
||
" <td>102821.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>36.0</td>\n",
|
||
" <td>36.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>272 rows × 6 columns</p>\n",
|
||
"</div>\n",
|
||
" <div class=\"colab-df-buttons\">\n",
|
||
"\n",
|
||
" <div class=\"colab-df-container\">\n",
|
||
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-02f2b63a-6a85-4d2c-b3bf-21981cfe56e6')\"\n",
|
||
" title=\"Convert this dataframe to an interactive table.\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
|
||
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
|
||
" </svg>\n",
|
||
" </button>\n",
|
||
"\n",
|
||
" <style>\n",
|
||
" .colab-df-container {\n",
|
||
" display:flex;\n",
|
||
" gap: 12px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert {\n",
|
||
" background-color: #E8F0FE;\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: #1967D2;\n",
|
||
" height: 32px;\n",
|
||
" padding: 0 0 0 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert:hover {\n",
|
||
" background-color: #E2EBFA;\n",
|
||
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: #174EA6;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-buttons div {\n",
|
||
" margin-bottom: 4px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert {\n",
|
||
" background-color: #3B4455;\n",
|
||
" fill: #D2E3FC;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert:hover {\n",
|
||
" background-color: #434B5C;\n",
|
||
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
||
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
||
" fill: #FFFFFF;\n",
|
||
" }\n",
|
||
" </style>\n",
|
||
"\n",
|
||
" <script>\n",
|
||
" const buttonEl =\n",
|
||
" document.querySelector('#df-02f2b63a-6a85-4d2c-b3bf-21981cfe56e6 button.colab-df-convert');\n",
|
||
" buttonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
"\n",
|
||
" async function convertToInteractive(key) {\n",
|
||
" const element = document.querySelector('#df-02f2b63a-6a85-4d2c-b3bf-21981cfe56e6');\n",
|
||
" const dataTable =\n",
|
||
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
|
||
" [key], {});\n",
|
||
" if (!dataTable) return;\n",
|
||
"\n",
|
||
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
|
||
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
|
||
" + ' to learn more about interactive tables.';\n",
|
||
" element.innerHTML = '';\n",
|
||
" dataTable['output_type'] = 'display_data';\n",
|
||
" await google.colab.output.renderOutput(dataTable, element);\n",
|
||
" const docLink = document.createElement('div');\n",
|
||
" docLink.innerHTML = docLinkHtml;\n",
|
||
" element.appendChild(docLink);\n",
|
||
" }\n",
|
||
" </script>\n",
|
||
" </div>\n",
|
||
"\n",
|
||
"\n",
|
||
"<div id=\"df-77122ec2-11de-4cce-a82a-480f982b0f10\">\n",
|
||
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-77122ec2-11de-4cce-a82a-480f982b0f10')\"\n",
|
||
" title=\"Suggest charts\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
|
||
" width=\"24px\">\n",
|
||
" <g>\n",
|
||
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
|
||
" </g>\n",
|
||
"</svg>\n",
|
||
" </button>\n",
|
||
"\n",
|
||
"<style>\n",
|
||
" .colab-df-quickchart {\n",
|
||
" --bg-color: #E8F0FE;\n",
|
||
" --fill-color: #1967D2;\n",
|
||
" --hover-bg-color: #E2EBFA;\n",
|
||
" --hover-fill-color: #174EA6;\n",
|
||
" --disabled-fill-color: #AAA;\n",
|
||
" --disabled-bg-color: #DDD;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-quickchart {\n",
|
||
" --bg-color: #3B4455;\n",
|
||
" --fill-color: #D2E3FC;\n",
|
||
" --hover-bg-color: #434B5C;\n",
|
||
" --hover-fill-color: #FFFFFF;\n",
|
||
" --disabled-bg-color: #3B4455;\n",
|
||
" --disabled-fill-color: #666;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-quickchart {\n",
|
||
" background-color: var(--bg-color);\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: var(--fill-color);\n",
|
||
" height: 32px;\n",
|
||
" padding: 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-quickchart:hover {\n",
|
||
" background-color: var(--hover-bg-color);\n",
|
||
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: var(--button-hover-fill-color);\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-quickchart-complete:disabled,\n",
|
||
" .colab-df-quickchart-complete:disabled:hover {\n",
|
||
" background-color: var(--disabled-bg-color);\n",
|
||
" fill: var(--disabled-fill-color);\n",
|
||
" box-shadow: none;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-spinner {\n",
|
||
" border: 2px solid var(--fill-color);\n",
|
||
" border-color: transparent;\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" animation:\n",
|
||
" spin 1s steps(1) infinite;\n",
|
||
" }\n",
|
||
"\n",
|
||
" @keyframes spin {\n",
|
||
" 0% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" border-left-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 20% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-left-color: var(--fill-color);\n",
|
||
" border-top-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 30% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-left-color: var(--fill-color);\n",
|
||
" border-top-color: var(--fill-color);\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 40% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" border-top-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 60% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 80% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 90% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"\n",
|
||
" <script>\n",
|
||
" async function quickchart(key) {\n",
|
||
" const quickchartButtonEl =\n",
|
||
" document.querySelector('#' + key + ' button');\n",
|
||
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
|
||
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
|
||
" try {\n",
|
||
" const charts = await google.colab.kernel.invokeFunction(\n",
|
||
" 'suggestCharts', [key], {});\n",
|
||
" } catch (error) {\n",
|
||
" console.error('Error during call to suggestCharts:', error);\n",
|
||
" }\n",
|
||
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
|
||
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
|
||
" }\n",
|
||
" (() => {\n",
|
||
" let quickchartButtonEl =\n",
|
||
" document.querySelector('#df-77122ec2-11de-4cce-a82a-480f982b0f10 button');\n",
|
||
" quickchartButtonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
" })();\n",
|
||
" </script>\n",
|
||
"</div>\n",
|
||
" </div>\n",
|
||
" </div>\n"
|
||
]
|
||
},
|
||
"metadata": {},
|
||
"execution_count": 101
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"# Do not run this cell if you are following the example above.\n",
|
||
"\n",
|
||
"# In this scenario, \"data\" could be anything that would be displayed as a bar chart. Alternatively, it could be company fundamentals data.\n",
|
||
"\n",
|
||
"# Note: This requires a valid FMP API key\n",
|
||
"\n",
|
||
"\n",
|
||
"symbol=\"AAPL\"\n",
|
||
"\n",
|
||
"data = obb.equity.fundamental.ratios(symbol, limit = 100, period=\"quarter\", provider=\"fmp\")\n",
|
||
"\n",
|
||
"data.index = data.index.strftime(\"%Y-%m-%d\")\n",
|
||
"\n",
|
||
"data"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 649
|
||
},
|
||
"id": "2fAclYaEMVz5",
|
||
"outputId": "10413c8a-253d-4aae-c837-644f8880923b"
|
||
},
|
||
"execution_count": 93,
|
||
"outputs": [
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
" symbol period current_ratio quick_ratio cash_ratio \\\n",
|
||
"date \n",
|
||
"1998-12-26 AAPL Q1 2.605795 2.352426 0.822776 \n",
|
||
"1999-03-27 AAPL Q2 2.650259 2.413212 0.879534 \n",
|
||
"1999-06-26 AAPL Q3 2.792723 2.600390 1.152047 \n",
|
||
"1999-09-25 AAPL Q4 2.766301 2.522272 0.856036 \n",
|
||
"2000-01-01 AAPL Q1 2.498219 2.316539 0.807125 \n",
|
||
"... ... ... ... ... ... \n",
|
||
"2022-09-24 AAPL Q4 0.879356 0.709408 0.153563 \n",
|
||
"2022-12-31 AAPL Q1 0.938020 0.768724 0.149578 \n",
|
||
"2023-04-01 AAPL Q2 0.940354 0.764281 0.205597 \n",
|
||
"2023-07-01 AAPL Q3 0.981563 0.813585 0.227331 \n",
|
||
"2023-09-30 AAPL Q4 0.988012 0.843312 0.206217 \n",
|
||
"\n",
|
||
" days_of_sales_outstanding days_of_inventory_outstanding \\\n",
|
||
"date \n",
|
||
"1998-12-26 48.052632 1.832248 \n",
|
||
"1999-03-27 47.294118 1.437445 \n",
|
||
"1999-06-26 51.758665 0.557029 \n",
|
||
"1999-09-25 45.875749 1.890756 \n",
|
||
"2000-01-01 34.263764 0.777650 \n",
|
||
"... ... ... \n",
|
||
"2022-09-24 60.833315 8.551997 \n",
|
||
"2022-12-31 41.622138 9.185598 \n",
|
||
"2023-04-01 34.068392 12.738933 \n",
|
||
"2023-07-01 43.115762 14.577604 \n",
|
||
"2023-09-30 61.327069 11.611542 \n",
|
||
"\n",
|
||
" operating_cycle days_of_payables_outstanding \\\n",
|
||
"date \n",
|
||
"1998-12-26 49.884879 48.004886 \n",
|
||
"1999-03-27 48.731562 63.167702 \n",
|
||
"1999-06-26 52.315694 63.023873 \n",
|
||
"1999-09-25 47.766505 76.764706 \n",
|
||
"2000-01-01 35.041414 60.864055 \n",
|
||
"... ... ... \n",
|
||
"2022-09-24 69.385312 110.859542 \n",
|
||
"2022-12-31 50.807736 78.007542 \n",
|
||
"2023-04-01 46.807325 73.118615 \n",
|
||
"2023-07-01 57.693367 92.607747 \n",
|
||
"2023-09-30 72.938611 114.833405 \n",
|
||
"\n",
|
||
" cash_conversion_cycle ... price_earnings_ratio \\\n",
|
||
"date ... \n",
|
||
"1998-12-26 1.879993 ... 8.732568 \n",
|
||
"1999-03-27 -14.436140 ... 8.397059 \n",
|
||
"1999-06-26 -10.708179 ... 7.484225 \n",
|
||
"1999-09-25 -28.998201 ... 23.552897 \n",
|
||
"2000-01-01 -25.822641 ... 22.618570 \n",
|
||
"... ... ... ... \n",
|
||
"2022-09-24 -41.474230 ... 29.094281 \n",
|
||
"2022-12-31 -27.199806 ... 17.208993 \n",
|
||
"2023-04-01 -26.311290 ... 26.938138 \n",
|
||
"2023-07-01 -34.914381 ... 38.288645 \n",
|
||
"2023-09-30 -41.894793 ... 29.085850 \n",
|
||
"\n",
|
||
" price_to_free_cash_flows_ratio \\\n",
|
||
"date \n",
|
||
"1998-12-26 24.355053 \n",
|
||
"1999-03-27 18.137648 \n",
|
||
"1999-06-26 75.027047 \n",
|
||
"1999-09-25 51.769733 \n",
|
||
"2000-01-01 49.423264 \n",
|
||
"... ... \n",
|
||
"2022-09-24 115.723695 \n",
|
||
"2022-12-31 68.334817 \n",
|
||
"2023-04-01 101.516990 \n",
|
||
"2023-07-01 125.370206 \n",
|
||
"2023-09-30 137.421101 \n",
|
||
"\n",
|
||
" price_to_operating_cash_flows_ratio price_cash_flow_ratio \\\n",
|
||
"date \n",
|
||
"1998-12-26 23.808976 23.808976 \n",
|
||
"1999-03-27 16.856551 16.856551 \n",
|
||
"1999-06-26 69.058986 69.058986 \n",
|
||
"1999-09-25 47.970120 47.970120 \n",
|
||
"2000-01-01 44.388186 44.388186 \n",
|
||
"... ... ... \n",
|
||
"2022-09-24 99.948206 99.948206 \n",
|
||
"2022-12-31 60.724643 60.724643 \n",
|
||
"2023-04-01 91.152020 91.152020 \n",
|
||
"2023-07-01 115.423282 115.423282 \n",
|
||
"2023-09-30 123.658630 123.658630 \n",
|
||
"\n",
|
||
" price_earnings_to_growth_ratio price_sales_ratio dividend_yield \\\n",
|
||
"date \n",
|
||
"1998-12-26 0.203760 3.104913 0.000000 \n",
|
||
"1999-03-27 -0.699755 2.963668 0.000000 \n",
|
||
"1999-06-26 0.178003 3.900636 0.000000 \n",
|
||
"1999-09-25 -0.467319 7.827460 0.000000 \n",
|
||
"2000-01-01 0.350588 7.066493 0.000000 \n",
|
||
"... ... ... ... \n",
|
||
"2022-09-24 3.879237 26.750498 0.001536 \n",
|
||
"2022-12-31 0.369993 17.625873 0.001825 \n",
|
||
"2023-04-01 -1.414252 27.450564 0.001402 \n",
|
||
"2023-07-01 -2.253139 37.224668 0.001264 \n",
|
||
"2023-09-30 1.846951 29.841774 0.001407 \n",
|
||
"\n",
|
||
" enterprise_value_multiple price_fair_value calendarYear \n",
|
||
"date \n",
|
||
"1998-12-26 28.650009 2.760999 1999 \n",
|
||
"1999-03-27 62.597153 2.084787 1999 \n",
|
||
"1999-06-26 209.281398 2.046192 1999 \n",
|
||
"1999-09-25 70.913430 3.369035 1999 \n",
|
||
"2000-01-01 58.063853 3.750973 2000 \n",
|
||
"... ... ... ... \n",
|
||
"2022-09-24 90.344514 47.589406 2022 \n",
|
||
"2022-12-31 55.366190 36.401387 2023 \n",
|
||
"2023-04-01 86.117046 41.882005 2023 \n",
|
||
"2023-07-01 135.913479 50.517075 2023 \n",
|
||
"2023-09-30 92.900618 42.975881 2023 \n",
|
||
"\n",
|
||
"[100 rows x 57 columns]"
|
||
],
|
||
"text/html": [
|
||
"\n",
|
||
" <div id=\"df-7cf38376-8f1c-43b9-9d1a-578e0f267575\" class=\"colab-df-container\">\n",
|
||
" <div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>symbol</th>\n",
|
||
" <th>period</th>\n",
|
||
" <th>current_ratio</th>\n",
|
||
" <th>quick_ratio</th>\n",
|
||
" <th>cash_ratio</th>\n",
|
||
" <th>days_of_sales_outstanding</th>\n",
|
||
" <th>days_of_inventory_outstanding</th>\n",
|
||
" <th>operating_cycle</th>\n",
|
||
" <th>days_of_payables_outstanding</th>\n",
|
||
" <th>cash_conversion_cycle</th>\n",
|
||
" <th>...</th>\n",
|
||
" <th>price_earnings_ratio</th>\n",
|
||
" <th>price_to_free_cash_flows_ratio</th>\n",
|
||
" <th>price_to_operating_cash_flows_ratio</th>\n",
|
||
" <th>price_cash_flow_ratio</th>\n",
|
||
" <th>price_earnings_to_growth_ratio</th>\n",
|
||
" <th>price_sales_ratio</th>\n",
|
||
" <th>dividend_yield</th>\n",
|
||
" <th>enterprise_value_multiple</th>\n",
|
||
" <th>price_fair_value</th>\n",
|
||
" <th>calendarYear</th>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>date</th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>1998-12-26</th>\n",
|
||
" <td>AAPL</td>\n",
|
||
" <td>Q1</td>\n",
|
||
" <td>2.605795</td>\n",
|
||
" <td>2.352426</td>\n",
|
||
" <td>0.822776</td>\n",
|
||
" <td>48.052632</td>\n",
|
||
" <td>1.832248</td>\n",
|
||
" <td>49.884879</td>\n",
|
||
" <td>48.004886</td>\n",
|
||
" <td>1.879993</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>8.732568</td>\n",
|
||
" <td>24.355053</td>\n",
|
||
" <td>23.808976</td>\n",
|
||
" <td>23.808976</td>\n",
|
||
" <td>0.203760</td>\n",
|
||
" <td>3.104913</td>\n",
|
||
" <td>0.000000</td>\n",
|
||
" <td>28.650009</td>\n",
|
||
" <td>2.760999</td>\n",
|
||
" <td>1999</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1999-03-27</th>\n",
|
||
" <td>AAPL</td>\n",
|
||
" <td>Q2</td>\n",
|
||
" <td>2.650259</td>\n",
|
||
" <td>2.413212</td>\n",
|
||
" <td>0.879534</td>\n",
|
||
" <td>47.294118</td>\n",
|
||
" <td>1.437445</td>\n",
|
||
" <td>48.731562</td>\n",
|
||
" <td>63.167702</td>\n",
|
||
" <td>-14.436140</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>8.397059</td>\n",
|
||
" <td>18.137648</td>\n",
|
||
" <td>16.856551</td>\n",
|
||
" <td>16.856551</td>\n",
|
||
" <td>-0.699755</td>\n",
|
||
" <td>2.963668</td>\n",
|
||
" <td>0.000000</td>\n",
|
||
" <td>62.597153</td>\n",
|
||
" <td>2.084787</td>\n",
|
||
" <td>1999</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1999-06-26</th>\n",
|
||
" <td>AAPL</td>\n",
|
||
" <td>Q3</td>\n",
|
||
" <td>2.792723</td>\n",
|
||
" <td>2.600390</td>\n",
|
||
" <td>1.152047</td>\n",
|
||
" <td>51.758665</td>\n",
|
||
" <td>0.557029</td>\n",
|
||
" <td>52.315694</td>\n",
|
||
" <td>63.023873</td>\n",
|
||
" <td>-10.708179</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>7.484225</td>\n",
|
||
" <td>75.027047</td>\n",
|
||
" <td>69.058986</td>\n",
|
||
" <td>69.058986</td>\n",
|
||
" <td>0.178003</td>\n",
|
||
" <td>3.900636</td>\n",
|
||
" <td>0.000000</td>\n",
|
||
" <td>209.281398</td>\n",
|
||
" <td>2.046192</td>\n",
|
||
" <td>1999</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1999-09-25</th>\n",
|
||
" <td>AAPL</td>\n",
|
||
" <td>Q4</td>\n",
|
||
" <td>2.766301</td>\n",
|
||
" <td>2.522272</td>\n",
|
||
" <td>0.856036</td>\n",
|
||
" <td>45.875749</td>\n",
|
||
" <td>1.890756</td>\n",
|
||
" <td>47.766505</td>\n",
|
||
" <td>76.764706</td>\n",
|
||
" <td>-28.998201</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>23.552897</td>\n",
|
||
" <td>51.769733</td>\n",
|
||
" <td>47.970120</td>\n",
|
||
" <td>47.970120</td>\n",
|
||
" <td>-0.467319</td>\n",
|
||
" <td>7.827460</td>\n",
|
||
" <td>0.000000</td>\n",
|
||
" <td>70.913430</td>\n",
|
||
" <td>3.369035</td>\n",
|
||
" <td>1999</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2000-01-01</th>\n",
|
||
" <td>AAPL</td>\n",
|
||
" <td>Q1</td>\n",
|
||
" <td>2.498219</td>\n",
|
||
" <td>2.316539</td>\n",
|
||
" <td>0.807125</td>\n",
|
||
" <td>34.263764</td>\n",
|
||
" <td>0.777650</td>\n",
|
||
" <td>35.041414</td>\n",
|
||
" <td>60.864055</td>\n",
|
||
" <td>-25.822641</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>22.618570</td>\n",
|
||
" <td>49.423264</td>\n",
|
||
" <td>44.388186</td>\n",
|
||
" <td>44.388186</td>\n",
|
||
" <td>0.350588</td>\n",
|
||
" <td>7.066493</td>\n",
|
||
" <td>0.000000</td>\n",
|
||
" <td>58.063853</td>\n",
|
||
" <td>3.750973</td>\n",
|
||
" <td>2000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>...</th>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>...</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2022-09-24</th>\n",
|
||
" <td>AAPL</td>\n",
|
||
" <td>Q4</td>\n",
|
||
" <td>0.879356</td>\n",
|
||
" <td>0.709408</td>\n",
|
||
" <td>0.153563</td>\n",
|
||
" <td>60.833315</td>\n",
|
||
" <td>8.551997</td>\n",
|
||
" <td>69.385312</td>\n",
|
||
" <td>110.859542</td>\n",
|
||
" <td>-41.474230</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>29.094281</td>\n",
|
||
" <td>115.723695</td>\n",
|
||
" <td>99.948206</td>\n",
|
||
" <td>99.948206</td>\n",
|
||
" <td>3.879237</td>\n",
|
||
" <td>26.750498</td>\n",
|
||
" <td>0.001536</td>\n",
|
||
" <td>90.344514</td>\n",
|
||
" <td>47.589406</td>\n",
|
||
" <td>2022</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2022-12-31</th>\n",
|
||
" <td>AAPL</td>\n",
|
||
" <td>Q1</td>\n",
|
||
" <td>0.938020</td>\n",
|
||
" <td>0.768724</td>\n",
|
||
" <td>0.149578</td>\n",
|
||
" <td>41.622138</td>\n",
|
||
" <td>9.185598</td>\n",
|
||
" <td>50.807736</td>\n",
|
||
" <td>78.007542</td>\n",
|
||
" <td>-27.199806</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>17.208993</td>\n",
|
||
" <td>68.334817</td>\n",
|
||
" <td>60.724643</td>\n",
|
||
" <td>60.724643</td>\n",
|
||
" <td>0.369993</td>\n",
|
||
" <td>17.625873</td>\n",
|
||
" <td>0.001825</td>\n",
|
||
" <td>55.366190</td>\n",
|
||
" <td>36.401387</td>\n",
|
||
" <td>2023</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2023-04-01</th>\n",
|
||
" <td>AAPL</td>\n",
|
||
" <td>Q2</td>\n",
|
||
" <td>0.940354</td>\n",
|
||
" <td>0.764281</td>\n",
|
||
" <td>0.205597</td>\n",
|
||
" <td>34.068392</td>\n",
|
||
" <td>12.738933</td>\n",
|
||
" <td>46.807325</td>\n",
|
||
" <td>73.118615</td>\n",
|
||
" <td>-26.311290</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>26.938138</td>\n",
|
||
" <td>101.516990</td>\n",
|
||
" <td>91.152020</td>\n",
|
||
" <td>91.152020</td>\n",
|
||
" <td>-1.414252</td>\n",
|
||
" <td>27.450564</td>\n",
|
||
" <td>0.001402</td>\n",
|
||
" <td>86.117046</td>\n",
|
||
" <td>41.882005</td>\n",
|
||
" <td>2023</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2023-07-01</th>\n",
|
||
" <td>AAPL</td>\n",
|
||
" <td>Q3</td>\n",
|
||
" <td>0.981563</td>\n",
|
||
" <td>0.813585</td>\n",
|
||
" <td>0.227331</td>\n",
|
||
" <td>43.115762</td>\n",
|
||
" <td>14.577604</td>\n",
|
||
" <td>57.693367</td>\n",
|
||
" <td>92.607747</td>\n",
|
||
" <td>-34.914381</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>38.288645</td>\n",
|
||
" <td>125.370206</td>\n",
|
||
" <td>115.423282</td>\n",
|
||
" <td>115.423282</td>\n",
|
||
" <td>-2.253139</td>\n",
|
||
" <td>37.224668</td>\n",
|
||
" <td>0.001264</td>\n",
|
||
" <td>135.913479</td>\n",
|
||
" <td>50.517075</td>\n",
|
||
" <td>2023</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2023-09-30</th>\n",
|
||
" <td>AAPL</td>\n",
|
||
" <td>Q4</td>\n",
|
||
" <td>0.988012</td>\n",
|
||
" <td>0.843312</td>\n",
|
||
" <td>0.206217</td>\n",
|
||
" <td>61.327069</td>\n",
|
||
" <td>11.611542</td>\n",
|
||
" <td>72.938611</td>\n",
|
||
" <td>114.833405</td>\n",
|
||
" <td>-41.894793</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>29.085850</td>\n",
|
||
" <td>137.421101</td>\n",
|
||
" <td>123.658630</td>\n",
|
||
" <td>123.658630</td>\n",
|
||
" <td>1.846951</td>\n",
|
||
" <td>29.841774</td>\n",
|
||
" <td>0.001407</td>\n",
|
||
" <td>92.900618</td>\n",
|
||
" <td>42.975881</td>\n",
|
||
" <td>2023</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>100 rows × 57 columns</p>\n",
|
||
"</div>\n",
|
||
" <div class=\"colab-df-buttons\">\n",
|
||
"\n",
|
||
" <div class=\"colab-df-container\">\n",
|
||
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-7cf38376-8f1c-43b9-9d1a-578e0f267575')\"\n",
|
||
" title=\"Convert this dataframe to an interactive table.\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
|
||
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
|
||
" </svg>\n",
|
||
" </button>\n",
|
||
"\n",
|
||
" <style>\n",
|
||
" .colab-df-container {\n",
|
||
" display:flex;\n",
|
||
" gap: 12px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert {\n",
|
||
" background-color: #E8F0FE;\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: #1967D2;\n",
|
||
" height: 32px;\n",
|
||
" padding: 0 0 0 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert:hover {\n",
|
||
" background-color: #E2EBFA;\n",
|
||
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: #174EA6;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-buttons div {\n",
|
||
" margin-bottom: 4px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert {\n",
|
||
" background-color: #3B4455;\n",
|
||
" fill: #D2E3FC;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert:hover {\n",
|
||
" background-color: #434B5C;\n",
|
||
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
||
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
||
" fill: #FFFFFF;\n",
|
||
" }\n",
|
||
" </style>\n",
|
||
"\n",
|
||
" <script>\n",
|
||
" const buttonEl =\n",
|
||
" document.querySelector('#df-7cf38376-8f1c-43b9-9d1a-578e0f267575 button.colab-df-convert');\n",
|
||
" buttonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
"\n",
|
||
" async function convertToInteractive(key) {\n",
|
||
" const element = document.querySelector('#df-7cf38376-8f1c-43b9-9d1a-578e0f267575');\n",
|
||
" const dataTable =\n",
|
||
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
|
||
" [key], {});\n",
|
||
" if (!dataTable) return;\n",
|
||
"\n",
|
||
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
|
||
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
|
||
" + ' to learn more about interactive tables.';\n",
|
||
" element.innerHTML = '';\n",
|
||
" dataTable['output_type'] = 'display_data';\n",
|
||
" await google.colab.output.renderOutput(dataTable, element);\n",
|
||
" const docLink = document.createElement('div');\n",
|
||
" docLink.innerHTML = docLinkHtml;\n",
|
||
" element.appendChild(docLink);\n",
|
||
" }\n",
|
||
" </script>\n",
|
||
" </div>\n",
|
||
"\n",
|
||
"\n",
|
||
"<div id=\"df-40497031-c39d-486f-975c-a6b353d3d6f1\">\n",
|
||
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-40497031-c39d-486f-975c-a6b353d3d6f1')\"\n",
|
||
" title=\"Suggest charts\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
|
||
" width=\"24px\">\n",
|
||
" <g>\n",
|
||
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
|
||
" </g>\n",
|
||
"</svg>\n",
|
||
" </button>\n",
|
||
"\n",
|
||
"<style>\n",
|
||
" .colab-df-quickchart {\n",
|
||
" --bg-color: #E8F0FE;\n",
|
||
" --fill-color: #1967D2;\n",
|
||
" --hover-bg-color: #E2EBFA;\n",
|
||
" --hover-fill-color: #174EA6;\n",
|
||
" --disabled-fill-color: #AAA;\n",
|
||
" --disabled-bg-color: #DDD;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-quickchart {\n",
|
||
" --bg-color: #3B4455;\n",
|
||
" --fill-color: #D2E3FC;\n",
|
||
" --hover-bg-color: #434B5C;\n",
|
||
" --hover-fill-color: #FFFFFF;\n",
|
||
" --disabled-bg-color: #3B4455;\n",
|
||
" --disabled-fill-color: #666;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-quickchart {\n",
|
||
" background-color: var(--bg-color);\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: var(--fill-color);\n",
|
||
" height: 32px;\n",
|
||
" padding: 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-quickchart:hover {\n",
|
||
" background-color: var(--hover-bg-color);\n",
|
||
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: var(--button-hover-fill-color);\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-quickchart-complete:disabled,\n",
|
||
" .colab-df-quickchart-complete:disabled:hover {\n",
|
||
" background-color: var(--disabled-bg-color);\n",
|
||
" fill: var(--disabled-fill-color);\n",
|
||
" box-shadow: none;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-spinner {\n",
|
||
" border: 2px solid var(--fill-color);\n",
|
||
" border-color: transparent;\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" animation:\n",
|
||
" spin 1s steps(1) infinite;\n",
|
||
" }\n",
|
||
"\n",
|
||
" @keyframes spin {\n",
|
||
" 0% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" border-left-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 20% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-left-color: var(--fill-color);\n",
|
||
" border-top-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 30% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-left-color: var(--fill-color);\n",
|
||
" border-top-color: var(--fill-color);\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 40% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" border-top-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 60% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 80% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-right-color: var(--fill-color);\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" 90% {\n",
|
||
" border-color: transparent;\n",
|
||
" border-bottom-color: var(--fill-color);\n",
|
||
" }\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"\n",
|
||
" <script>\n",
|
||
" async function quickchart(key) {\n",
|
||
" const quickchartButtonEl =\n",
|
||
" document.querySelector('#' + key + ' button');\n",
|
||
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
|
||
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
|
||
" try {\n",
|
||
" const charts = await google.colab.kernel.invokeFunction(\n",
|
||
" 'suggestCharts', [key], {});\n",
|
||
" } catch (error) {\n",
|
||
" console.error('Error during call to suggestCharts:', error);\n",
|
||
" }\n",
|
||
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
|
||
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
|
||
" }\n",
|
||
" (() => {\n",
|
||
" let quickchartButtonEl =\n",
|
||
" document.querySelector('#df-40497031-c39d-486f-975c-a6b353d3d6f1 button');\n",
|
||
" quickchartButtonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
" })();\n",
|
||
" </script>\n",
|
||
"</div>\n",
|
||
" </div>\n",
|
||
" </div>\n"
|
||
]
|
||
},
|
||
"metadata": {},
|
||
"execution_count": 93
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"# Create a widget for selecting the data to display.\n",
|
||
"\n",
|
||
"clear_output(wait = False)\n",
|
||
"\n",
|
||
"data_choices = data.columns.tolist()\n",
|
||
"data_selection = widgets.Dropdown(\n",
|
||
" options = data_choices,\n",
|
||
" value = None,\n",
|
||
")\n",
|
||
"output = widgets.Output()\n",
|
||
"\n",
|
||
"\n",
|
||
"def generate_figure(data, data_choice):\n",
|
||
" data = data[data[data_choice].notnull()]\n",
|
||
" fig = go.Figure()\n",
|
||
" fig.add_bar(\n",
|
||
" y = data[data_choice][data[data_choice] > 0].values,\n",
|
||
" x = data[data_choice][data[data_choice] > 0].index,\n",
|
||
" name = data_choice,\n",
|
||
" marker = dict(color = \"blue\"),\n",
|
||
" )\n",
|
||
" fig.add_bar(\n",
|
||
" y = data[data_choice][data[data_choice] < 0].values,\n",
|
||
" x = data[data_choice][data[data_choice] < 0].index,\n",
|
||
" name = data_choice,\n",
|
||
" marker = dict(color = \"red\")\n",
|
||
" )\n",
|
||
" fig.update_xaxes(type=\"category\")\n",
|
||
" fig.update_traces(width=0.98, selector=dict(type=\"bar\"))\n",
|
||
" fig.update_layout(\n",
|
||
" showlegend=False,\n",
|
||
" width=1400,\n",
|
||
" height=600,\n",
|
||
" title = dict(\n",
|
||
" text=f\"{symbol} {data_choice.replace('_', ' ').title()}\",\n",
|
||
" xanchor = \"center\",\n",
|
||
" x = 0.5,\n",
|
||
" font = dict(size = 20)\n",
|
||
" ),\n",
|
||
" barmode=\"overlay\",\n",
|
||
" bargap=0,\n",
|
||
" bargroupgap=0,\n",
|
||
" yaxis=dict(\n",
|
||
" ticklen=0,\n",
|
||
" showgrid=True,\n",
|
||
" tickfont=dict(size=14),\n",
|
||
" ),\n",
|
||
" xaxis=dict(\n",
|
||
" showgrid=False,\n",
|
||
" autorange=True,\n",
|
||
" tickangle=90,\n",
|
||
" tickfont=dict(size=11),\n",
|
||
" ),\n",
|
||
" )\n",
|
||
" return fig\n",
|
||
"\n",
|
||
"def on_value_change(change):\n",
|
||
" clear_output(wait = True)\n",
|
||
" display(data_selection)\n",
|
||
" with output:\n",
|
||
" data_selection.value\n",
|
||
"\n",
|
||
"data_selection.observe(on_value_change, names=\"value\")\n",
|
||
"display(data_selection)\n",
|
||
"\n",
|
||
"# Select from the drop-down menu below."
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 49,
|
||
"referenced_widgets": [
|
||
"fc6a4747cea243f4bac6a19c43264fec",
|
||
"bf10b4a3831f4e6595398f2d62a0f7b2",
|
||
"6095af63918f4075a891fc950c9790d3"
|
||
]
|
||
},
|
||
"id": "jvvAtHfvMkXB",
|
||
"outputId": "6155ecd8-5bec-4fb7-ef77-52b3bb325af7"
|
||
},
|
||
"execution_count": 102,
|
||
"outputs": [
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
"Dropdown(options=('Total Open Interest', 'Call Open Interest', 'Put Open Interest', 'Total Volume', 'Call Volu…"
|
||
],
|
||
"application/vnd.jupyter.widget-view+json": {
|
||
"version_major": 2,
|
||
"version_minor": 0,
|
||
"model_id": "fc6a4747cea243f4bac6a19c43264fec"
|
||
}
|
||
},
|
||
"metadata": {}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"# Play this cell to display the choice\n",
|
||
"\n",
|
||
"if data_selection.value is not None:\n",
|
||
"\n",
|
||
" generate_figure(data, data_selection.value).show()"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 617
|
||
},
|
||
"id": "J9D5Qq0sQOwH",
|
||
"outputId": "91092fb7-c313-4305-eed2-00d6b5750a8b"
|
||
},
|
||
"execution_count": 106,
|
||
"outputs": [
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/html": [
|
||
"<html>\n",
|
||
"<head><meta charset=\"utf-8\" /></head>\n",
|
||
"<body>\n",
|
||
" <div> <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script> <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
|
||
" <script charset=\"utf-8\" src=\"https://cdn.plot.ly/plotly-2.27.0.min.js\"></script> <div id=\"bd364da0-3ff3-405a-a34f-67ffc2e881f9\" class=\"plotly-graph-div\" style=\"height:600px; width:1400px;\"></div> <script type=\"text/javascript\"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"bd364da0-3ff3-405a-a34f-67ffc2e881f9\")) { Plotly.newPlot( \"bd364da0-3ff3-405a-a34f-67ffc2e881f9\", [{\"marker\":{\"color\":\"blue\"},\"name\":\"Total Open Interest\",\"x\":[120.0,130.0,140.0,150.0,155.0,160.0,165.0,170.0,175.0,180.0,185.0,190.0,195.0,200.0,205.0,210.0,215.0,220.0,225.0,230.0,235.0,240.0,245.0,250.0,255.0,260.0,265.0,270.0,275.0,280.0,285.0,290.0,295.0,300.0,305.0,310.0,315.0,320.0,325.0,326.0,327.0,328.0,329.0,330.0,331.0,332.0,333.0,334.0,335.0,336.0,337.0,338.0,339.0,340.0,341.0,342.0,343.0,344.0,345.0,346.0,347.0,348.0,349.0,350.0,351.0,352.0,353.0,354.0,355.0,356.0,357.0,358.0,359.0,360.0,361.0,362.0,363.0,364.0,365.0,366.0,367.0,368.0,369.0,370.0,371.0,372.0,373.0,374.0,375.0,376.0,377.0,378.0,379.0,380.0,381.0,382.0,383.0,384.0,385.0,386.0,387.0,388.0,389.0,390.0,391.0,392.0,393.0,394.0,395.0,396.0,397.0,398.0,399.0,400.0,401.0,402.0,403.0,404.0,405.0,406.0,407.0,407.5,408.0,409.0,410.0,411.0,412.0,412.5,413.0,414.0,415.0,416.0,417.0,417.5,418.0,419.0,420.0,421.0,422.0,422.5,423.0,424.0,425.0,426.0,427.0,427.5,428.0,429.0,430.0,431.0,432.0,432.5,433.0,434.0,435.0,436.0,437.0,437.5,438.0,439.0,440.0,441.0,442.0,442.5,443.0,444.0,445.0,446.0,447.0,447.5,448.0,449.0,450.0,451.0,452.0,452.5,453.0,454.0,455.0,456.0,457.0,457.5,458.0,459.0,460.0,461.0,462.0,462.5,463.0,464.0,465.0,466.0,467.0,468.0,469.0,470.0,471.0,472.0,473.0,474.0,475.0,476.0,477.0,478.0,479.0,480.0,481.0,482.0,483.0,484.0,485.0,486.0,487.0,488.0,489.0,490.0,491.0,492.0,493.0,494.0,495.0,496.0,497.0,498.0,499.0,500.0,501.0,505.0,510.0,515.0,520.0,525.0,530.0,535.0,540.0,545.0,550.0,555.0,560.0,565.0,570.0,575.0,580.0,585.0,590.0,595.0,600.0,605.0,610.0,615.0,620.0,625.0,630.0,635.0,640.0,645.0,650.0,655.0,660.0,665.0,670.0,675.0,680.0,685.0,690.0,695.0,700.0,705.0,710.0,715.0,720.0],\"y\":[22821.0,1506.0,488.0,72684.0,12298.0,10083.0,10038.0,8360.0,9993.0,37606.0,32521.0,29836.0,20895.0,85139.0,24243.0,36551.0,26012.0,56622.0,23829.0,33532.0,17942.0,60632.0,35338.0,56527.0,18032.0,30316.0,30396.0,50209.0,61207.0,37026.0,50770.0,45185.0,65071.0,159070.0,53484.0,60967.0,57744.0,129600.0,109020.0,2146.0,722.0,2169.0,1340.0,133922.0,1021.0,600.0,6250.0,3915.0,98360.0,2251.0,1611.0,1133.0,1853.0,233517.0,2456.0,2804.0,2161.0,1495.0,209334.0,3899.0,5856.0,2493.0,4623.0,351448.0,6703.0,3386.0,3971.0,9834.0,239268.0,11716.0,7837.0,10534.0,13891.0,346649.0,5110.0,6728.0,4857.0,6349.0,241408.0,7327.0,17883.0,5797.0,10619.0,343956.0,7276.0,10860.0,24680.0,6971.0,285228.0,34212.0,8126.0,18856.0,12456.0,396584.0,12257.0,13430.0,15293.0,8502.0,355884.0,28496.0,8962.0,18364.0,10199.0,387739.0,19228.0,26884.0,38312.0,18468.0,317318.0,17398.0,52484.0,43708.0,20780.0,837400.0,30090.0,68012.0,59031.0,37417.0,479691.0,36668.0,72792.0,6570.0,54367.0,33032.0,413051.0,52289.0,72313.0,5688.0,86823.0,85569.0,384574.0,99860.0,47672.0,2956.0,48813.0,60772.0,573979.0,58836.0,87094.0,7284.0,83241.0,86451.0,325378.0,54454.0,82792.0,8865.0,74976.0,58801.0,554627.0,78622.0,134847.0,9534.0,84599.0,98230.0,388402.0,79630.0,78821.0,16208.0,103767.0,85884.0,579060.0,84556.0,94083.0,9933.0,84010.0,107284.0,419216.0,104896.0,157843.0,13630.0,140469.0,116466.0,580880.0,103277.0,140617.0,419.0,135349.0,135063.0,464252.0,155421.0,151442.0,264.0,132704.0,86808.0,540118.0,70502.0,95487.0,464.0,47076.0,58790.0,216515.0,45784.0,43140.0,36199.0,24123.0,227538.0,41618.0,39258.0,24366.0,25858.0,149346.0,33728.0,20640.0,22863.0,13496.0,256224.0,17288.0,18526.0,13245.0,9592.0,78595.0,6223.0,10567.0,6595.0,4966.0,102532.0,7202.0,4953.0,14529.0,11969.0,59821.0,11719.0,3194.0,5977.0,5599.0,149694.0,6120.0,79019.0,83626.0,66910.0,100439.0,58070.0,82737.0,45110.0,49113.0,40460.0,101677.0,57058.0,41655.0,32809.0,32979.0,22414.0,52753.0,8495.0,8062.0,7546.0,82029.0,10335.0,6059.0,10055.0,3992.0,10612.0,12064.0,5544.0,1155.0,2855.0,11228.0,40848.0,72462.0,16886.0,38843.0,5235.0,4188.0,3506.0,2461.0,2047.0,24945.0,478.0,1511.0,981.0,102823.0],\"type\":\"bar\",\"width\":0.98},{\"marker\":{\"color\":\"red\"},\"name\":\"Total Open Interest\",\"x\":[],\"y\":[],\"type\":\"bar\",\"width\":0.98}], {\"template\":{\"data\":{\"histogram2dcontour\":[{\"type\":\"histogram2dcontour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"choropleth\":[{\"type\":\"choropleth\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"histogram2d\":[{\"type\":\"histogram2d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmap\":[{\"type\":\"heatmap\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmapgl\":[{\"type\":\"heatmapgl\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"type\":\"contourcarpet\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"contour\":[{\"type\":\"contour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"surface\":[{\"type\":\"surface\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"type\":\"mesh3d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"scatter\":[{\"fillpattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2},\"type\":\"scatter\"}],\"parcoords\":[{\"type\":\"parcoords\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"type\":\"scatterpolargl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"bar\":[{\"error_x\":{\"color\":\"#2a3f5f\"},\"error_y\":{\"color\":\"#2a3f5f\"},\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"scattergeo\":[{\"type\":\"scattergeo\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"type\":\"scatterpolar\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"scattergl\":[{\"type\":\"scattergl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"type\":\"scatter3d\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"type\":\"scattermapbox\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"type\":\"scatterternary\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"type\":\"scattercarpet\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"baxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"type\":\"carpet\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#EBF0F8\"},\"line\":{\"color\":\"white\"}},\"header\":{\"fill\":{\"color\":\"#C8D4E3\"},\"line\":{\"color\":\"white\"}},\"type\":\"table\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}]},\"layout\":{\"autotypenumbers\":\"strict\",\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#2a3f5f\"},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"#E5ECF6\",\"polar\":{\"bgcolor\":\"#E5ECF6\",\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"ternary\":{\"bgcolor\":\"#E5ECF6\",\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]]},\"xaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"yaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"yaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"zaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2}},\"shapedefaults\":{\"line\":{\"color\":\"#2a3f5f\"}},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"geo\":{\"bgcolor\":\"white\",\"landcolor\":\"#E5ECF6\",\"subunitcolor\":\"white\",\"showland\":true,\"showlakes\":true,\"lakecolor\":\"white\"},\"title\":{\"x\":0.05},\"mapbox\":{\"style\":\"light\"}}},\"xaxis\":{\"type\":\"category\",\"tickfont\":{\"size\":11},\"showgrid\":false,\"autorange\":true,\"tickangle\":90},\"title\":{\"font\":{\"size\":20},\"text\":\"AAPL Total Open Interest\",\"xanchor\":\"center\",\"x\":0.5},\"yaxis\":{\"tickfont\":{\"size\":14},\"ticklen\":0,\"showgrid\":true},\"showlegend\":false,\"width\":1400,\"height\":600,\"barmode\":\"overlay\",\"bargap\":0,\"bargroupgap\":0}, {\"responsive\": true} ).then(function(){\n",
|
||
" \n",
|
||
"var gd = document.getElementById('bd364da0-3ff3-405a-a34f-67ffc2e881f9');\n",
|
||
"var x = new MutationObserver(function (mutations, observer) {{\n",
|
||
" var display = window.getComputedStyle(gd).display;\n",
|
||
" if (!display || display === 'none') {{\n",
|
||
" console.log([gd, 'removed!']);\n",
|
||
" Plotly.purge(gd);\n",
|
||
" observer.disconnect();\n",
|
||
" }}\n",
|
||
"}});\n",
|
||
"\n",
|
||
"// Listen for the removal of the full notebook cells\n",
|
||
"var notebookContainer = gd.closest('#notebook-container');\n",
|
||
"if (notebookContainer) {{\n",
|
||
" x.observe(notebookContainer, {childList: true});\n",
|
||
"}}\n",
|
||
"\n",
|
||
"// Listen for the clearing of the current output cell\n",
|
||
"var outputEl = gd.closest('.output');\n",
|
||
"if (outputEl) {{\n",
|
||
" x.observe(outputEl, {childList: true});\n",
|
||
"}}\n",
|
||
"\n",
|
||
" }) }; </script> </div>\n",
|
||
"</body>\n",
|
||
"</html>"
|
||
]
|
||
},
|
||
"metadata": {}
|
||
}
|
||
]
|
||
}
|
||
]
|
||
} |