mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
* First working program * added Voila support * Attempt to fix requirements * Revert depen * Another dependency test * Fixed errors * Small changes * Fixed help * Added port warning * Fixed continued terminal use * Last change, we good fam * Added placeholder so we can have stored * Didier changes * Fixed exit * Fixed issue
255 lines
6.6 KiB
Plaintext
Vendored
255 lines
6.6 KiB
Plaintext
Vendored
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "driven-billion",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Import most generic modules\n",
|
|
"import importlib\n",
|
|
"import pathlib\n",
|
|
"import os\n",
|
|
"import sys\n",
|
|
"from datetime import datetime, timedelta\n",
|
|
"import pandas as pd\n",
|
|
"from IPython.display import display, Markdown\n",
|
|
"import warnings\n",
|
|
"warnings.filterwarnings('ignore')\n",
|
|
"module_path = os.path.abspath(os.path.join('../..'))\n",
|
|
"\n",
|
|
"if module_path not in sys.path:\n",
|
|
" sys.path.append(module_path)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "intended-sherman",
|
|
"metadata": {
|
|
"tags": [
|
|
"parameters"
|
|
]
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Parameters that will be replaced when calling this notebook\n",
|
|
"ticker=\"AMC\"\n",
|
|
"\n",
|
|
"report_name=f\"{datetime.now().strftime('%Y%m%d_%H%M%S')}_dark_pool_{ticker.upper()}\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "mounted-phase",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"display(Markdown(f\"# {ticker.upper()} - Dark Pool - {datetime.now().strftime('%Y/%m/%d %H:%M:%S')}\"))"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "capable-allergy",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Top 10 Negative Dark Pool Positions"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "statewide-debate",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from gamestonk_terminal.stocks.dark_pool_shorts import stockgrid_view\n",
|
|
"stockgrid_view.dark_pool_short_positions(num=10, \n",
|
|
" sort_field=\"dpp_dollar\", \n",
|
|
" ascending=True, \n",
|
|
" export=\"\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "artificial-tampa",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Top 10 Most Highly Shorted Stocks"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "smaller-association",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from gamestonk_terminal.stocks.dark_pool_shorts import shortinterest_view\n",
|
|
"shortinterest_view.high_short_interest(num=10,\n",
|
|
" export=\"\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "cleared-contemporary",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Dark Pool Activity"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "medical-tomato",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from gamestonk_terminal.stocks.dark_pool_shorts import stockgrid_view\n",
|
|
"stockgrid_view.net_short_position(ticker=ticker.upper(), \n",
|
|
" num=60,\n",
|
|
" raw=False,\n",
|
|
" export=\"\")\n",
|
|
"\n",
|
|
"stockgrid_view.net_short_position(ticker=ticker.upper(), \n",
|
|
" num=10,\n",
|
|
" raw=True,\n",
|
|
" export=\"\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "comprehensive-nashville",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from gamestonk_terminal.stocks.dark_pool_shorts import stockgrid_view\n",
|
|
"stockgrid_view.short_interest_volume(ticker=ticker.upper(), \n",
|
|
" num=60,\n",
|
|
" raw=False,\n",
|
|
" export=\"\")\n",
|
|
"\n",
|
|
"stockgrid_view.short_interest_volume(ticker=ticker.upper(), \n",
|
|
" num=10,\n",
|
|
" raw=True,\n",
|
|
" export=\"\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "decreased-mills",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Options info"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "medical-shaft",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from gamestonk_terminal.stocks.options import barchart_view\n",
|
|
"barchart_view.print_options_data(ticker=ticker.upper(), \n",
|
|
" export=\"\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "understood-houston",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Put and Call Open Interest Expiring next"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "acute-burning",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from gamestonk_terminal.stocks.options import yfinance_model, yfinance_view\n",
|
|
"\n",
|
|
"selected_date = yfinance_model.option_expirations(ticker)[0]\n",
|
|
"options = yfinance_model.get_option_chain(ticker, selected_date)\n",
|
|
"\n",
|
|
"yfinance_view.plot_oi(ticker=ticker,\n",
|
|
" expiry=selected_date,\n",
|
|
" min_sp=-1,\n",
|
|
" max_sp=-1,\n",
|
|
" calls_only=False,\n",
|
|
" puts_only=False,\n",
|
|
" export=\"\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "convinced-orleans",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Failure-to-deliver (30 days lag)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "capital-narrow",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from gamestonk_terminal.stocks import stocks_helper\n",
|
|
"from gamestonk_terminal.stocks.dark_pool_shorts import sec_view\n",
|
|
" \n",
|
|
"stock = stocks_helper.load(ticker)\n",
|
|
"\n",
|
|
"sec_view.fails_to_deliver(\n",
|
|
" ticker=ticker.upper(), \n",
|
|
" stock=stock,\n",
|
|
" start=datetime.now() - timedelta(days=60),\n",
|
|
" end=datetime.now(),\n",
|
|
" num=0,\n",
|
|
" raw=False,\n",
|
|
" export=\"\"\n",
|
|
")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "above-prior",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"!jupyter nbconvert {report_name + \".ipynb\"} --to html --no-input"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"celltoolbar": "Tags",
|
|
"kernelspec": {
|
|
"display_name": "Python 3 (ipykernel)",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.8.6"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|