diff --git a/openbb_terminal/config_terminal.py b/openbb_terminal/config_terminal.py index a0816d4d976..076aed4801e 100644 --- a/openbb_terminal/config_terminal.py +++ b/openbb_terminal/config_terminal.py @@ -181,3 +181,6 @@ API_EODHD_KEY = os.getenv("OPENBB_API_EODHD_KEY") or "REPLACE_ME" # https://tokenterminal.com API_TOKEN_TERMINAL_KEY = os.getenv("OPENBB_API_TOKEN_TERMINAL_KEY") or "REPLACE_ME" + +# https://stocksera.pythonanywhere.com/accounts/developers +API_STOCKSERA_KEY = os.getenv("OPENBB_API_STOCKSERA_KEY") or "REPLACE_ME" diff --git a/openbb_terminal/keys_controller.py b/openbb_terminal/keys_controller.py index 693c037fef9..8d7259e9678 100644 --- a/openbb_terminal/keys_controller.py +++ b/openbb_terminal/keys_controller.py @@ -81,6 +81,8 @@ class KeysController(BaseController): # pylint: disable=too-many-public-methods elif status_msg == str(keys_model.KeyStatus.NOT_DEFINED): c = "grey30" + if status_msg is None: + status_msg = str(keys_model.KeyStatus.NOT_DEFINED) mt.add_raw( f" [cmds]{cmd_name}[/cmds] {(20 - len(cmd_name)) * ' '}" f" [{c}] {api_name} {(25 - len(api_name)) * ' '} {translate(status_msg)} [/{c}]\n" @@ -1114,3 +1116,33 @@ class KeysController(BaseController): # pylint: disable=too-many-public-methods self.status_dict["tokenterminal"] = keys_model.set_tokenterminal_key( key=ns_parser.key, persist=True, show_output=True ) + + @log_start_end(log=logger) + def call_stocksera(self, other_args: List[str]): + """Process stocksera command""" + parser = argparse.ArgumentParser( + add_help=False, + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + prog="stocksera", + description="Set Stocksera API key.", + ) + parser.add_argument( + "-k", + "--key", + type=str, + dest="key", + help="key", + ) + if not other_args: + console.print( + "For your API Key, https://stocksera.pythonanywhere.com/accounts/developers\n" + ) + return + + if other_args and "-" not in other_args[0][0]: + other_args.insert(0, "-k") + ns_parser = parse_simple_args(parser, other_args) + if ns_parser: + self.status_dict["stocksera"] = keys_model.set_stocksera_key( + key=ns_parser.key, persist=True, show_output=True + ) diff --git a/openbb_terminal/keys_model.py b/openbb_terminal/keys_model.py index 684869f675e..8d5071f9303 100644 --- a/openbb_terminal/keys_model.py +++ b/openbb_terminal/keys_model.py @@ -15,6 +15,7 @@ import binance import pandas as pd import quandl import requests +import stocksera from prawcore.exceptions import ResponseException import praw import pyEX @@ -80,6 +81,7 @@ API_DICT: Dict = { "santiment": "SANTIMENT", "tokenterminal": "TOKEN_TERMINAL", "shroom": "SHROOM", + "stocksera": "STOCKSERA", } @@ -2106,3 +2108,57 @@ def check_tokenterminal_key(show_output: bool = False) -> str: console.print(status.colorize() + "\n") return str(status) + + +def set_stocksera_key(key: str, persist: bool = False, show_output: bool = False): + """Set Stocksera key. + + Parameters + ---------- + key: str + API key + persist: bool + If False, api key change will be contained to where it was changed. For example, Jupyter notebook. + If True, api key change will be global, i.e. it will affect terminal environment variables. + By default, False. + show_output: bool + Display status string or not. By default, False. + + Returns + ------- + status: str + + """ + set_key("OPENBB_API_STOCKSERA_KEY", key, persist) + return check_stocksera_key(show_output) + + +def check_stocksera_key(show_output: bool = False): + """Check Stocksera key + Parameters + ---------- + show_output: bool + Display status string or not. By default, False. + + Returns + ------- + status: str + """ + if cfg.API_STOCKSERA_KEY == "REPLACE_ME": + logger.info("Stocksera key not defined") + status = KeyStatus.NOT_DEFINED + else: + + client = stocksera.Client(api_key=cfg.API_STOCKSERA_KEY) + + try: + client.borrowed_shares(ticker="AAPL") + logger.info("Stocksera key defined, test passed") + status = KeyStatus.DEFINED_TEST_PASSED + except Exception as _: # noqa: F841 + logger.warning("Stocksera key defined, test failed") + status = KeyStatus.DEFINED_TEST_FAILED + + if show_output: + console.print(status.colorize() + "\n") + return str(status) diff --git a/openbb_terminal/miscellaneous/data_sources_default.json b/openbb_terminal/miscellaneous/data_sources_default.json index 3fc8b6aab2d..785444b8a6b 100644 --- a/openbb_terminal/miscellaneous/data_sources_default.json +++ b/openbb_terminal/miscellaneous/data_sources_default.json @@ -102,7 +102,8 @@ "dpotc": ["FINRA"], "ftd": ["SEC"], "spos": ["Stockgrid"], - "psi": ["Stockgrid", "Quandl"] + "psi": ["Stockgrid", "Quandl"], + "ctb": ["ibkr", "stocksera"] }, "scr": { "view": [], diff --git a/openbb_terminal/miscellaneous/i18n/en.yml b/openbb_terminal/miscellaneous/i18n/en.yml index 8ddc44932f4..4204c97bc96 100644 --- a/openbb_terminal/miscellaneous/i18n/en.yml +++ b/openbb_terminal/miscellaneous/i18n/en.yml @@ -226,7 +226,7 @@ en: stocks/sia/ca: take these to comparison analysis menu stocks/dps/load: load a specific stock ticker for analysis stocks/dps/shorted: show most shorted stocks - stocks/dps/ctb: stocks with highest cost to borrow + stocks/dps/ctb: cost to borrow of stocks stocks/dps/hsi: show top high short interest stocks of over 20% ratio stocks/dps/prom: promising tickers based on dark pool shares regression stocks/dps/pos: dark pool short position diff --git a/openbb_terminal/miscellaneous/scripts/test_stocks_dps.openbb b/openbb_terminal/miscellaneous/scripts/test_stocks_dps.openbb index 6b8a38110e9..83d440fcffe 100644 --- a/openbb_terminal/miscellaneous/scripts/test_stocks_dps.openbb +++ b/openbb_terminal/miscellaneous/scripts/test_stocks_dps.openbb @@ -2,6 +2,7 @@ stocks dps shorted ctb +ctb -source stocksera hsi pos sidtc diff --git a/openbb_terminal/stocks/dark_pool_shorts/dps_controller.py b/openbb_terminal/stocks/dark_pool_shorts/dps_controller.py index 44e146acbad..577bf9c55c4 100644 --- a/openbb_terminal/stocks/dark_pool_shorts/dps_controller.py +++ b/openbb_terminal/stocks/dark_pool_shorts/dps_controller.py @@ -30,6 +30,7 @@ from openbb_terminal.stocks.dark_pool_shorts import ( stockgrid_view, yahoofinance_view, ibkr_view, + stocksera_view, ) logger = logging.getLogger(__name__) @@ -213,7 +214,7 @@ class DarkPoolShortsController(StockBaseController): add_help=False, formatter_class=argparse.ArgumentDefaultsHelpFormatter, prog="ctb", - description="Print stocks with highest cost to borrow. [Source: Interactive Broker]", + description="Show cost to borrow of stocks. [Source: Stocksera/Interactive Broker]", ) parser.add_argument( "-n", @@ -222,18 +223,28 @@ class DarkPoolShortsController(StockBaseController): dest="number", type=check_int_range(1, 10000), default=20, - help="Number of stocks with high cost to borrow to retrieve.", + help="Number of records to retrieve.", + ) + parser.add_argument( + "--raw", + action="store_true", + default=False, + dest="raw", + help="Print raw data.", ) - if other_args and "-" not in other_args[0][0]: - other_args.insert(0, "-l") ns_parser = self.parse_known_args_and_warn( parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED ) if ns_parser: - ibkr_view.display_cost_to_borrow( - limit=ns_parser.number, - export=ns_parser.export, - ) + if ns_parser.source == "ibkr": + ibkr_view.display_cost_to_borrow( + limit=ns_parser.number, + export=ns_parser.export, + ) + else: + stocksera_view.cost_to_borrow( + self.ticker, limit=ns_parser.number, raw=ns_parser.raw + ) @log_start_end(log=logger) def call_hsi(self, other_args: List[str]): diff --git a/openbb_terminal/stocks/dark_pool_shorts/stocksera_model.py b/openbb_terminal/stocks/dark_pool_shorts/stocksera_model.py new file mode 100644 index 00000000000..4d77b336dac --- /dev/null +++ b/openbb_terminal/stocks/dark_pool_shorts/stocksera_model.py @@ -0,0 +1,43 @@ +"""Stocksera model""" +__docformat__ = "numpy" + +import logging + +import stocksera +import pandas as pd + +from stocksera.exceptions import StockseraRequestException + +from openbb_terminal import config_terminal as cfg +from openbb_terminal.decorators import log_start_end +from openbb_terminal.rich_config import console + +logger = logging.getLogger(__name__) + + +@log_start_end(log=logger) +def get_cost_to_borrow(symbol: str) -> pd.DataFrame: + """Get cost to borrow of stocks [Source: Stocksera] + Parameters + ---------- + symbol : str + ticker to get cost to borrow from + Returns + ------- + pd.DataFrame + Cost to borrow + """ + + df = pd.DataFrame() + + try: + client = stocksera.Client(api_key=cfg.API_STOCKSERA_KEY) + df = pd.DataFrame(client.borrowed_shares(ticker=symbol)) + df.columns = ["Ticker", "Fees", "Available", "Date"] + df.set_index("Date", inplace=True) + + except StockseraRequestException: + console.print("[red]Invalid API Key[/red]\n") + except Exception as e: + console.print(f"[red]{e}[/red]\n") + return df diff --git a/openbb_terminal/stocks/dark_pool_shorts/stocksera_view.py b/openbb_terminal/stocks/dark_pool_shorts/stocksera_view.py new file mode 100644 index 00000000000..25acf756b16 --- /dev/null +++ b/openbb_terminal/stocks/dark_pool_shorts/stocksera_view.py @@ -0,0 +1,135 @@ +""" Stocksera View """ +__docformat__ = "numpy" + +import logging +import os +from typing import List, Optional + +import matplotlib.ticker +import pandas as pd +from matplotlib import pyplot as plt + +from openbb_terminal.decorators import check_api_key +from openbb_terminal.config_terminal import theme +from openbb_terminal.decorators import log_start_end +from openbb_terminal.config_plot import PLOT_DPI +from openbb_terminal.helper_funcs import ( + export_data, + lambda_long_number_format, + print_rich_table, + plot_autoscale, + is_valid_axes_count, +) +from openbb_terminal.stocks.dark_pool_shorts import stocksera_model +from openbb_terminal.rich_config import console + +logger = logging.getLogger(__name__) + + +@log_start_end(log=logger) +def plot_cost_to_borrow( + symbol: str, + data: pd.DataFrame, + external_axes: Optional[List[plt.Axes]] = None, +): + """Plots the cost to borrow of a stock. [Source: Stocksera] + Parameters + ---------- + symbol : str + ticker to get cost to borrow from + data: pd.DataFrame + Cost to borrow dataframe + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None + """ + + # This plot has 2 axes + if not external_axes: + _, ax1 = plt.subplots(figsize=plot_autoscale(), dpi=PLOT_DPI) + ax2 = ax1.twinx() + elif is_valid_axes_count(external_axes, 2): + (ax1, ax2) = external_axes + else: + return + + if data.empty: + return + + ax1.bar( + data.index, + data["Available"], + 0.3, + color=theme.up_color, + ) + + ax1.set_title(f"Cost to Borrow of {symbol}") + + ax1.legend(labels=["Number Shares"], loc="best") + ax1.yaxis.set_major_formatter(matplotlib.ticker.EngFormatter()) + + ax2.set_ylabel("Fees %") + ax2.plot(data.index, data["Fees"].values) + ax2.tick_params(axis="y", which="major") + + theme.style_twin_axes(ax1, ax2) + + ax1.xaxis.set_major_locator(matplotlib.ticker.MaxNLocator(6)) + + if not external_axes: + theme.visualize_output() + + +@log_start_end(log=logger) +@check_api_key(["API_STOCKSERA_KEY"]) +def cost_to_borrow( + symbol: str, + limit: int = 100, + raw: bool = False, + export: str = "", + external_axes: Optional[List[plt.Axes]] = None, +): + """Plots the short interest of a stock. This corresponds to the + number of shares that have been sold short but have not yet been + covered or closed out. Either NASDAQ or NYSE [Source: Quandl] + Parameters + ---------- + symbol : str + ticker to get cost to borrow from + limit: int + Number of historical cost to borrow data to show + raw : bool + Flag to print raw data instead + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None + """ + # Note: if you send an empty string stocksera will search every ticker + if not symbol: + console.print("[red]No symbol provided[/red]\n") + return + df_cost_to_borrow = stocksera_model.get_cost_to_borrow(symbol) + + df_cost_to_borrow = df_cost_to_borrow.head(limit)[::-1] + + pd.options.mode.chained_assignment = None + + plot_cost_to_borrow(symbol, df_cost_to_borrow, external_axes) + + if raw: + df_cost_to_borrow["Available"] = df_cost_to_borrow["Available"].apply( + lambda x: lambda_long_number_format(x) + ) + print_rich_table( + df_cost_to_borrow, + headers=list(df_cost_to_borrow.columns), + show_index=True, + title=f"Cost to Borrow of {symbol}", + ) + + export_data( + export, + os.path.dirname(os.path.abspath(__file__)), + "stocksera", + df_cost_to_borrow, + ) diff --git a/poetry.lock b/poetry.lock index 454224a33e0..7bf50f50e37 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1066,7 +1066,7 @@ gitdb = ">=4.0.1,<5" [[package]] name = "grpcio" -version = "1.49.1" +version = "1.50.0" description = "HTTP/2-based RPC framework" category = "main" optional = false @@ -1076,7 +1076,7 @@ python-versions = ">=3.7" six = ">=1.5.2" [package.extras] -protobuf = ["grpcio-tools (>=1.49.1)"] +protobuf = ["grpcio-tools (>=1.50.0)"] [[package]] name = "h11" @@ -1879,11 +1879,11 @@ test = ["pytest (<5.4)", "pytest-cov"] [[package]] name = "more-itertools" -version = "8.14.0" +version = "9.0.0" description = "More routines for operating on iterables, beyond itertools" category = "main" optional = false -python-versions = ">=3.5" +python-versions = ">=3.7" [[package]] name = "mplfinance" @@ -2230,7 +2230,7 @@ pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" [[package]] name = "pandas" -version = "1.5.0" +version = "1.5.1" description = "Powerful data structures for data analysis, time series, and statistics" category = "main" optional = false @@ -2540,7 +2540,7 @@ requests = "*" [[package]] name = "psutil" -version = "5.9.2" +version = "5.9.3" description = "Cross-platform lib for process and system monitoring in Python." category = "main" optional = false @@ -3084,7 +3084,7 @@ requests = ">=2.0" [[package]] name = "pytz" -version = "2022.4" +version = "2022.5" description = "World timezone definitions, modern and historical" category = "main" optional = false @@ -3726,6 +3726,18 @@ python-versions = ">=3.8" [package.dependencies] pbr = ">=2.0.0,<2.1.0 || >2.1.0" +[[package]] +name = "stocksera" +version = "0.1.21" +description = "Official Stocksera API" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +pandas = "*" +requests = "*" + [[package]] name = "streamlit" version = "1.13.0" @@ -3944,13 +3956,14 @@ requests = "*" [[package]] name = "traitlets" -version = "5.4.0" +version = "5.5.0" description = "" category = "main" optional = false python-versions = ">=3.7" [package.extras] +docs = ["myst-parser", "pydata-sphinx-theme", "sphinx"] test = ["pre-commit", "pytest"] [[package]] @@ -4346,7 +4359,7 @@ prediction = ["torch"] [metadata] lock-version = "1.1" python-versions = "^3.8,<3.11, !=3.9.7" -content-hash = "e8f775dcd95fd3f54e30eee355252e33e01619e070847be661b4e95b20ef1936" +content-hash = "c221577c37f21f30c12f8ccf882c6ca0bfdfc2afe303ea803d33bb7622bdc8d2" [metadata.files] aiodns = [] @@ -4880,53 +4893,7 @@ gitdb = [ {file = "gitdb-4.0.9.tar.gz", hash = "sha256:bac2fd45c0a1c9cf619e63a90d62bdc63892ef92387424b855792a6cabe789aa"}, ] gitpython = [] -grpcio = [ - {file = "grpcio-1.49.1-cp310-cp310-linux_armv7l.whl", hash = "sha256:fd86040232e805b8e6378b2348c928490ee595b058ce9aaa27ed8e4b0f172b20"}, - {file = "grpcio-1.49.1-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:6fd0c9cede9552bf00f8c5791d257d5bf3790d7057b26c59df08be5e7a1e021d"}, - {file = "grpcio-1.49.1-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:d0d402e158d4e84e49c158cb5204119d55e1baf363ee98d6cb5dce321c3a065d"}, - {file = "grpcio-1.49.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:822ceec743d42a627e64ea266059a62d214c5a3cdfcd0d7fe2b7a8e4e82527c7"}, - {file = "grpcio-1.49.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2106d9c16527f0a85e2eea6e6b91a74fc99579c60dd810d8690843ea02bc0f5f"}, - {file = "grpcio-1.49.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:52dd02b7e7868233c571b49bc38ebd347c3bb1ff8907bb0cb74cb5f00c790afc"}, - {file = "grpcio-1.49.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:120fecba2ec5d14b5a15d11063b39783fda8dc8d24addd83196acb6582cabd9b"}, - {file = "grpcio-1.49.1-cp310-cp310-win32.whl", hash = "sha256:f1a3b88e3c53c1a6e6bed635ec1bbb92201bb6a1f2db186179f7f3f244829788"}, - {file = "grpcio-1.49.1-cp310-cp310-win_amd64.whl", hash = "sha256:a7d0017b92d3850abea87c1bdec6ea41104e71c77bca44c3e17f175c6700af62"}, - {file = "grpcio-1.49.1-cp311-cp311-linux_armv7l.whl", hash = "sha256:9fb17ff8c0d56099ac6ebfa84f670c5a62228d6b5c695cf21c02160c2ac1446b"}, - {file = "grpcio-1.49.1-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:075f2d06e3db6b48a2157a1bcd52d6cbdca980dd18988fe6afdb41795d51625f"}, - {file = "grpcio-1.49.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:46d93a1b4572b461a227f1db6b8d35a88952db1c47e5fadcf8b8a2f0e1dd9201"}, - {file = "grpcio-1.49.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc79b2b37d779ac42341ddef40ad5bf0966a64af412c89fc2b062e3ddabb093f"}, - {file = "grpcio-1.49.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5f8b3a971c7820ea9878f3fd70086240a36aeee15d1b7e9ecbc2743b0e785568"}, - {file = "grpcio-1.49.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:49b301740cf5bc8fed4fee4c877570189ae3951432d79fa8e524b09353659811"}, - {file = "grpcio-1.49.1-cp311-cp311-win32.whl", hash = "sha256:1c66a25afc6c71d357867b341da594a5587db5849b48f4b7d5908d236bb62ede"}, - {file = "grpcio-1.49.1-cp311-cp311-win_amd64.whl", hash = "sha256:6b6c3a95d27846f4145d6967899b3ab25fffc6ae99544415e1adcacef84842d2"}, - {file = "grpcio-1.49.1-cp37-cp37m-linux_armv7l.whl", hash = "sha256:1cc400c8a2173d1c042997d98a9563e12d9bb3fb6ad36b7f355bc77c7663b8af"}, - {file = "grpcio-1.49.1-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:34f736bd4d0deae90015c0e383885b431444fe6b6c591dea288173df20603146"}, - {file = "grpcio-1.49.1-cp37-cp37m-manylinux_2_17_aarch64.whl", hash = "sha256:196082b9c89ebf0961dcd77cb114bed8171964c8e3063b9da2fb33536a6938ed"}, - {file = "grpcio-1.49.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8c9f89c42749890618cd3c2464e1fbf88446e3d2f67f1e334c8e5db2f3272bbd"}, - {file = "grpcio-1.49.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64419cb8a5b612cdb1550c2fd4acbb7d4fb263556cf4625f25522337e461509e"}, - {file = "grpcio-1.49.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:8a5272061826e6164f96e3255405ef6f73b88fd3e8bef464c7d061af8585ac62"}, - {file = "grpcio-1.49.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ea9d0172445241ad7cb49577314e39d0af2c5267395b3561d7ced5d70458a9f3"}, - {file = "grpcio-1.49.1-cp37-cp37m-win32.whl", hash = "sha256:2070e87d95991473244c72d96d13596c751cb35558e11f5df5414981e7ed2492"}, - {file = "grpcio-1.49.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fcedcab49baaa9db4a2d240ac81f2d57eb0052b1c6a9501b46b8ae912720fbf"}, - {file = "grpcio-1.49.1-cp38-cp38-linux_armv7l.whl", hash = "sha256:afbb3475cf7f4f7d380c2ca37ee826e51974f3e2665613996a91d6a58583a534"}, - {file = "grpcio-1.49.1-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:a4f9ba141380abde6c3adc1727f21529137a2552002243fa87c41a07e528245c"}, - {file = "grpcio-1.49.1-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:cf0a1fb18a7204b9c44623dfbd1465b363236ce70c7a4ed30402f9f60d8b743b"}, - {file = "grpcio-1.49.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:17bb6fe72784b630728c6cff9c9d10ccc3b6d04e85da6e0a7b27fb1d135fac62"}, - {file = "grpcio-1.49.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:18305d5a082d1593b005a895c10041f833b16788e88b02bb81061f5ebcc465df"}, - {file = "grpcio-1.49.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:b6a1b39e59ac5a3067794a0e498911cf2e37e4b19ee9e9977dc5e7051714f13f"}, - {file = "grpcio-1.49.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:0e20d59aafc086b1cc68400463bddda6e41d3e5ed30851d1e2e0f6a2e7e342d3"}, - {file = "grpcio-1.49.1-cp38-cp38-win32.whl", hash = "sha256:e1e83233d4680863a421f3ee4a7a9b80d33cd27ee9ed7593bc93f6128302d3f2"}, - {file = "grpcio-1.49.1-cp38-cp38-win_amd64.whl", hash = "sha256:221d42c654d2a41fa31323216279c73ed17d92f533bc140a3390cc1bd78bf63c"}, - {file = "grpcio-1.49.1-cp39-cp39-linux_armv7l.whl", hash = "sha256:fa9e6e61391e99708ac87fc3436f6b7b9c6b845dc4639b406e5e61901e1aacde"}, - {file = "grpcio-1.49.1-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:9b449e966ef518ce9c860d21f8afe0b0f055220d95bc710301752ac1db96dd6a"}, - {file = "grpcio-1.49.1-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:aa34d2ad9f24e47fa9a3172801c676e4037d862247e39030165fe83821a7aafd"}, - {file = "grpcio-1.49.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5207f4eed1b775d264fcfe379d8541e1c43b878f2b63c0698f8f5c56c40f3d68"}, - {file = "grpcio-1.49.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b24a74651438d45619ac67004638856f76cc13d78b7478f2457754cbcb1c8ad"}, - {file = "grpcio-1.49.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:fe763781669790dc8b9618e7e677c839c87eae6cf28b655ee1fa69ae04eea03f"}, - {file = "grpcio-1.49.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2f2ff7ba0f8f431f32d4b4bc3a3713426949d3533b08466c4ff1b2b475932ca8"}, - {file = "grpcio-1.49.1-cp39-cp39-win32.whl", hash = "sha256:08ff74aec8ff457a89b97152d36cb811dcc1d17cd5a92a65933524e363327394"}, - {file = "grpcio-1.49.1-cp39-cp39-win_amd64.whl", hash = "sha256:274ffbb39717918c514b35176510ae9be06e1d93121e84d50b350861dcb9a705"}, - {file = "grpcio-1.49.1.tar.gz", hash = "sha256:d4725fc9ec8e8822906ae26bb26f5546891aa7fbc3443de970cc556d43a5c99f"}, -] +grpcio = [] h11 = [] hijri-converter = [ {file = "hijri-converter-2.2.4.tar.gz", hash = "sha256:9e1d9fa4c220f6867da2abb1a96240675ae974abba951c686a781f4ef6ac218f"}, @@ -5714,10 +5681,7 @@ pytrends = [ {file = "pytrends-4.8.0-py2-none-any.whl", hash = "sha256:31a76cf560a23a9eb691a9a83a3306bbe555ed1665122a5756e789829f56a0ef"}, {file = "pytrends-4.8.0.tar.gz", hash = "sha256:04b7b33eb6dfc120aa89cb4640688a8b633337276b6ddcea44ff0c7f6b6243d2"}, ] -pytz = [ - {file = "pytz-2022.4-py2.py3-none-any.whl", hash = "sha256:2c0784747071402c6e99f0bafdb7da0fa22645f06554c7ae06bf6358897e9c91"}, - {file = "pytz-2022.4.tar.gz", hash = "sha256:48ce799d83b6f8aab2020e369b627446696619e79645419610b9facd909b3174"}, -] +pytz = [] pytz-deprecation-shim = [ {file = "pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl", hash = "sha256:8314c9692a636c8eb3bda879b9f119e350e93223ae83e70e80c31675a0fdc1a6"}, {file = "pytz_deprecation_shim-0.1.0.post0.tar.gz", hash = "sha256:af097bae1b616dde5c5744441e2ddc69e74dfdcb0c263129610d85b87445a59d"}, @@ -6184,6 +6148,7 @@ statsmodels = [ {file = "statsmodels-0.13.2.tar.gz", hash = "sha256:77dc292c9939c036a476f1770f9d08976b05437daa229928da73231147cde7d4"}, ] stevedore = [] +stocksera = [] streamlit = [] tabulate = [ {file = "tabulate-0.9.0-py3-none-any.whl", hash = "sha256:024ca478df22e9340661486f85298cff5f6dcdba14f3813e8830015b9ed1948f"}, diff --git a/pyproject.toml b/pyproject.toml index 2b2df189d65..60a29f38b19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -101,6 +101,7 @@ ipyflex = "^0.2.4" setuptools = "^65.4.1" investiny = "^0.5.0" numpy = "1.21.6" +stocksera = "^0.1.21" [tool.poetry.dev-dependencies] pytest = "^6.2.2" diff --git a/requirements-full.txt b/requirements-full.txt index d0b57422217..b3007d01cb7 100644 --- a/requirements-full.txt +++ b/requirements-full.txt @@ -83,7 +83,7 @@ fundamentalanalysis==0.2.14 future==0.18.2; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" gitdb==4.0.9; python_version >= "3.7" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.7" gitpython==3.1.29; python_version >= "3.7" -grpcio==1.49.1; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.7" +grpcio==1.50.0; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.7" h11==0.12.0; python_version >= "3.8" and python_version < "4.0" hijri-converter==2.2.4; python_version >= "3.7" holidays==0.14.2; python_version >= "3.7" @@ -135,7 +135,7 @@ mccabe==0.6.1; python_full_version >= "3.7.2" mdit-py-plugins==0.2.8; python_version >= "3.6" and python_version < "4.0" mistune==0.8.4; python_version >= "3.7" mock==4.0.3; python_version >= "3.6" -more-itertools==8.14.0; python_version >= "3.6" +more-itertools==9.0.0; python_version >= "3.7" mplfinance==0.12.9b1 multidict==6.0.2; python_version >= "3.7" and python_full_version >= "3.7.0" multitasking==0.0.11 @@ -162,7 +162,7 @@ packaging==21.3; python_version >= "3.8" and python_full_version < "3.9.7" and p pandas-datareader==0.10.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6" pandas-market-calendars==3.2; python_full_version >= "3.7.0" pandas-ta==0.3.14b -pandas==1.5.0; python_version >= "3.8" +pandas==1.5.1; python_version >= "3.8" pandocfilters==1.5.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.7" parso==0.8.3; python_version >= "3.8" and python_full_version >= "3.7.0" and python_full_version < "4.0.0" pathspec==0.10.1; python_version >= "3.7" @@ -183,7 +183,7 @@ prompt-toolkit==3.0.31; python_full_version >= "3.6.2" property-cached==1.6.4; python_version >= "3.8" protobuf==3.20.3; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.7" and (python_version >= "3.7" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.7") psaw==0.0.12; python_version >= "3" -psutil==5.9.2; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7" +psutil==5.9.3; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7" ptyprocess==0.7.0; os_name != "nt" and python_version >= "3.8" and sys_platform != "win32" and python_full_version >= "3.7.0" and python_full_version < "4.0.0" pure-eval==0.2.2; python_version >= "3.8" and python_full_version >= "3.7.0" and python_full_version < "4.0.0" py==1.11.0; python_full_version >= "3.7.0" and python_version >= "3.7" and python_full_version < "4.0.0" and implementation_name == "pypy" @@ -224,7 +224,7 @@ python-dotenv==0.19.2; python_version >= "3.5" python-i18n==0.3.9 pytrends==4.8.0 pytz-deprecation-shim==0.1.0.post0; python_version >= "3.7" and python_full_version < "3.0.0" or python_version >= "3.7" and python_full_version < "3.9.7" and python_full_version >= "3.6.0" or python_full_version > "3.9.7" and python_version >= "3.6" -pytz==2022.4; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.8" and (python_version >= "3.8" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.8") and python_version < "4.0" +pytz==2022.5; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.8" and (python_version >= "3.8" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.8") and python_version < "4.0" pyupgrade==2.38.4; python_version >= "3.7" pywin32==304; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.7" pywinpty==2.0.8; os_name == "nt" and python_version >= "3.7" @@ -273,6 +273,7 @@ sseclient==0.0.27 stack-data==0.5.1; python_version >= "3.8" and python_full_version >= "3.7.0" and python_full_version < "4.0.0" statsmodels==0.13.2; python_version >= "3.7" stevedore==4.0.1; python_version >= "3.8" +stocksera==0.1.21; python_version >= "3.6" streamlit==1.13.0; (python_version >= "3.7" and python_full_version < "3.9.7") or (python_full_version > "3.9.7") tabulate==0.9.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7" temporal-cache==0.1.4 @@ -291,7 +292,7 @@ torch==1.11.0; python_full_version >= "3.7.0" tornado==6.2; python_version >= "3.7" and python_full_version < "3.9.7" and python_full_version >= "3.7.0" or python_full_version > "3.9.7" and python_version >= "3.7" and python_full_version < "4.0.0" tqdm==4.64.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" tradingview-ta==3.3.0; python_version >= "3.6" -traitlets==5.4.0; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.8" +traitlets==5.5.0; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.8" types-python-dateutil==2.8.19.2 types-pytz==2021.3.8 types-pyyaml==6.0.12 diff --git a/requirements.txt b/requirements.txt index 57f6a7901e8..457e7d0d006 100644 --- a/requirements.txt +++ b/requirements.txt @@ -72,7 +72,7 @@ fundamentalanalysis==0.2.14 future==0.18.2; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" gitdb==4.0.9; python_version >= "3.7" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.7" gitpython==3.1.29; python_version >= "3.7" -grpcio==1.49.1; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.7" +grpcio==1.50.0; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.7" h11==0.12.0; python_version >= "3.8" and python_version < "4.0" hijri-converter==2.2.4; python_version >= "3.7" holidays==0.14.2; python_version >= "3.7" @@ -116,7 +116,7 @@ matplotlib-inline==0.1.6; python_version >= "3.8" matplotlib==3.5.3; python_version >= "3.7" mccabe==0.6.1; python_full_version >= "3.7.0" mistune==0.8.4; python_version >= "3.7" -more-itertools==8.14.0; python_version >= "3.6" +more-itertools==9.0.0; python_version >= "3.7" mplfinance==0.12.9b1 multidict==6.0.2; python_version >= "3.7" and python_full_version >= "3.7.0" multitasking==0.0.11 @@ -140,7 +140,7 @@ packaging==21.3; python_version >= "3.8" and python_full_version < "3.9.7" or py pandas-datareader==0.10.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6" pandas-market-calendars==3.2; python_full_version >= "3.7.0" pandas-ta==0.3.14b -pandas==1.5.0; python_version >= "3.8" +pandas==1.5.1; python_version >= "3.8" pandocfilters==1.5.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.7" parso==0.8.3; python_version >= "3.8" pathspec==0.10.1; python_version >= "3.7" @@ -158,7 +158,7 @@ prompt-toolkit==3.0.31; python_full_version >= "3.6.2" property-cached==1.6.4; python_version >= "3.8" protobuf==3.20.3; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.7" and (python_version >= "3.7" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.7") psaw==0.0.12; python_version >= "3" -psutil==5.9.2; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.7" +psutil==5.9.3; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.7" ptyprocess==0.7.0; os_name != "nt" and python_version >= "3.8" and sys_platform != "win32" pure-eval==0.2.2; python_version >= "3.8" py==1.11.0; python_version >= "3.7" and python_full_version < "3.0.0" and implementation_name == "pypy" or implementation_name == "pypy" and python_version >= "3.7" and python_full_version >= "3.5.0" @@ -193,7 +193,7 @@ python-dotenv==0.19.2; python_version >= "3.5" python-i18n==0.3.9 pytrends==4.8.0 pytz-deprecation-shim==0.1.0.post0; python_version >= "3.7" and python_full_version < "3.0.0" or python_version >= "3.7" and python_full_version < "3.9.7" and python_full_version >= "3.6.0" or python_full_version > "3.9.7" and python_version >= "3.6" -pytz==2022.4; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.8" and (python_version >= "3.8" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.8") and python_version < "4.0" +pytz==2022.5; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.8" and (python_version >= "3.8" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.8") and python_version < "4.0" pywin32==304; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.7" pywinpty==2.0.8; os_name == "nt" and python_version >= "3.7" pyyaml==6.0; python_version >= "3.8" @@ -232,6 +232,7 @@ squarify==0.4.3 sseclient==0.0.27 stack-data==0.5.1; python_version >= "3.8" statsmodels==0.13.2; python_version >= "3.7" +stocksera==0.1.21; python_version >= "3.6" streamlit==1.13.0; (python_version >= "3.7" and python_full_version < "3.9.7") or (python_full_version > "3.9.7") tabulate==0.9.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7" temporal-cache==0.1.4 @@ -247,7 +248,7 @@ toolz==0.12.0; python_version >= "3.8" and python_version < "4.0" and python_ful tornado==6.2; python_version >= "3.7" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.7" tqdm==4.64.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" tradingview-ta==3.3.0; python_version >= "3.6" -traitlets==5.4.0; python_version >= "3.8" and python_full_version >= "3.7.0" +traitlets==5.5.0; python_version >= "3.8" and python_full_version >= "3.7.0" typing-extensions==4.4.0; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version < "3.9" and python_version >= "3.7" and (python_version >= "3.7" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.7") and (python_version >= "3.7" and python_full_version < "3.9.7" or python_full_version > "3.9.7") tzdata==2022.5; python_version >= "3.7" and python_full_version < "3.0.0" and platform_system == "Windows" or python_version >= "3.7" and python_full_version < "3.9.7" and platform_system == "Windows" and python_full_version >= "3.6.0" or python_full_version > "3.9.7" and python_version >= "3.6" and platform_system == "Windows" tzlocal==4.2; python_version >= "3.7" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.6" diff --git a/tests/openbb_terminal/stocks/dark_pool_shorts/cassettes/test_stocksera_model/test_get_cost_to_borrow.yaml b/tests/openbb_terminal/stocks/dark_pool_shorts/cassettes/test_stocksera_model/test_get_cost_to_borrow.yaml new file mode 100644 index 00000000000..7f81b23ddec --- /dev/null +++ b/tests/openbb_terminal/stocks/dark_pool_shorts/cassettes/test_stocksera_model/test_get_cost_to_borrow.yaml @@ -0,0 +1,120 @@ +interactions: +- request: + body: null + headers: + Accept-Encoding: + - gzip, deflate + Authorization: + - Token B2Pkbvgg.rZpUFr105BqA0uOc8JtyxYUYnfU9rPMm + Connection: + - keep-alive + User-Agent: + - python-requests/2.28.1 + accept: + - application/json + method: GET + uri: https://stocksera.pythonanywhere.com/api/borrowed_shares/TSLA + response: + body: + string: '' + headers: + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - text/html; charset=utf-8 + Date: + - Wed, 19 Oct 2022 15:22:20 GMT + Location: + - /api/borrowed_shares/TSLA/ + Referrer-Policy: + - same-origin + Server: + - PythonAnywhere + X-Clacks-Overhead: + - GNU Terry Pratchett + X-Content-Type-Options: + - nosniff + status: + code: 301 + message: Moved Permanently +- request: + body: null + headers: + Accept-Encoding: + - gzip, deflate + Authorization: + - Token B2Pkbvgg.rZpUFr105BqA0uOc8JtyxYUYnfU9rPMm + Connection: + - keep-alive + User-Agent: + - python-requests/2.28.1 + accept: + - application/json + method: GET + uri: https://stocksera.pythonanywhere.com/api/borrowed_shares/TSLA/ + response: + body: + string: !!binary | + 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 + headers: + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 19 Oct 2022 15:22:21 GMT + Referrer-Policy: + - same-origin + Server: + - PythonAnywhere + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Clacks-Overhead: + - GNU Terry Pratchett + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - ALLOW-FROM HTTPS://ECONIVERSE.GITHUB.IO + status: + code: 200 + message: OK +version: 1 diff --git a/tests/openbb_terminal/stocks/dark_pool_shorts/cassettes/test_stocksera_view/test_cost_to_borrow.yaml b/tests/openbb_terminal/stocks/dark_pool_shorts/cassettes/test_stocksera_view/test_cost_to_borrow.yaml new file mode 100644 index 00000000000..d10e95bc828 --- /dev/null +++ b/tests/openbb_terminal/stocks/dark_pool_shorts/cassettes/test_stocksera_view/test_cost_to_borrow.yaml @@ -0,0 +1,120 @@ +interactions: +- request: + body: null + headers: + Accept-Encoding: + - gzip, deflate + Authorization: + - Token B2Pkbvgg.rZpUFr105BqA0uOc8JtyxYUYnfU9rPMm + Connection: + - keep-alive + User-Agent: + - python-requests/2.28.1 + accept: + - application/json + method: GET + uri: https://stocksera.pythonanywhere.com/api/borrowed_shares/TSLA + response: + body: + string: '' + headers: + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - text/html; charset=utf-8 + Date: + - Wed, 19 Oct 2022 15:22:21 GMT + Location: + - /api/borrowed_shares/TSLA/ + Referrer-Policy: + - same-origin + Server: + - PythonAnywhere + X-Clacks-Overhead: + - GNU Terry Pratchett + X-Content-Type-Options: + - nosniff + status: + code: 301 + message: Moved Permanently +- request: + body: null + headers: + Accept-Encoding: + - gzip, deflate + Authorization: + - Token B2Pkbvgg.rZpUFr105BqA0uOc8JtyxYUYnfU9rPMm + Connection: + - keep-alive + User-Agent: + - python-requests/2.28.1 + accept: + - application/json + method: GET + uri: https://stocksera.pythonanywhere.com/api/borrowed_shares/TSLA/ + response: + body: + string: !!binary | + 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 + headers: + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 19 Oct 2022 15:22:22 GMT + Referrer-Policy: + - same-origin + Server: + - PythonAnywhere + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Clacks-Overhead: + - GNU Terry Pratchett + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - ALLOW-FROM HTTPS://ECONIVERSE.GITHUB.IO + status: + code: 200 + message: OK +version: 1 diff --git a/tests/openbb_terminal/stocks/dark_pool_shorts/csv/test_stocksera_model/test_get_cost_to_borrow.csv b/tests/openbb_terminal/stocks/dark_pool_shorts/csv/test_stocksera_model/test_get_cost_to_borrow.csv new file mode 100644 index 00000000000..c2975e8d168 --- /dev/null +++ b/tests/openbb_terminal/stocks/dark_pool_shorts/csv/test_stocksera_model/test_get_cost_to_borrow.csv @@ -0,0 +1,535 @@ +Date,Ticker,Fees,Available +2022-10-19 10:21,TSLA,0.25,10000000 +2022-10-19 10:01,TSLA,0.25,10000000 +2022-10-19 09:51,TSLA,0.25,10000000 +2022-10-19 09:40,TSLA,0.25,10000000 +2022-10-19 09:30,TSLA,0.25,10000000 +2022-10-19 09:20,TSLA,0.25,10000000 +2022-10-19 09:10,TSLA,0.25,10000000 +2022-10-19 09:02,TSLA,0.25,10000000 +2022-10-19 08:51,TSLA,0.25,10000000 +2022-10-19 08:40,TSLA,0.25,10000000 +2022-10-19 08:30,TSLA,0.25,10000000 +2022-10-19 08:20,TSLA,0.25,10000000 +2022-10-19 08:10,TSLA,0.25,10000000 +2022-10-19 08:02,TSLA,0.25,10000000 +2022-10-19 07:50,TSLA,0.25,10000000 +2022-10-19 07:40,TSLA,0.25,10000000 +2022-10-19 07:30,TSLA,0.25,10000000 +2022-10-19 07:20,TSLA,0.25,10000000 +2022-10-19 07:10,TSLA,0.25,10000000 +2022-10-19 07:02,TSLA,0.25,10000000 +2022-10-18 16:50,TSLA,0.25,10000000 +2022-10-18 16:40,TSLA,0.25,10000000 +2022-10-18 16:30,TSLA,0.25,10000000 +2022-10-18 16:20,TSLA,0.25,10000000 +2022-10-18 16:10,TSLA,0.25,10000000 +2022-10-18 16:02,TSLA,0.25,10000000 +2022-10-18 15:50,TSLA,0.25,10000000 +2022-10-18 15:40,TSLA,0.25,10000000 +2022-10-18 15:31,TSLA,0.25,10000000 +2022-10-18 15:20,TSLA,0.25,10000000 +2022-10-18 15:10,TSLA,0.2652,10000000 +2022-10-18 14:50,TSLA,0.2652,10000000 +2022-10-18 14:40,TSLA,0.2652,10000000 +2022-10-18 14:30,TSLA,0.2652,10000000 +2022-10-18 14:20,TSLA,0.2652,10000000 +2022-10-18 14:10,TSLA,0.2652,10000000 +2022-10-18 14:01,TSLA,0.2652,10000000 +2022-10-18 13:51,TSLA,0.2652,10000000 +2022-10-18 13:40,TSLA,0.2652,10000000 +2022-10-18 13:30,TSLA,0.2652,10000000 +2022-10-18 13:20,TSLA,0.2652,10000000 +2022-10-18 13:10,TSLA,0.3057,10000000 +2022-10-18 13:01,TSLA,0.3057,10000000 +2022-10-18 12:51,TSLA,0.3057,10000000 +2022-10-18 12:40,TSLA,0.3057,10000000 +2022-10-18 12:31,TSLA,0.3057,10000000 +2022-10-18 12:20,TSLA,0.3057,10000000 +2022-10-18 12:10,TSLA,0.3057,10000000 +2022-10-18 12:01,TSLA,0.3057,10000000 +2022-10-18 11:50,TSLA,0.3057,10000000 +2022-10-18 11:40,TSLA,0.3057,10000000 +2022-10-18 11:30,TSLA,0.3057,10000000 +2022-10-18 11:20,TSLA,0.3057,10000000 +2022-10-18 11:10,TSLA,0.3529,10000000 +2022-10-18 11:01,TSLA,0.3529,10000000 +2022-10-18 10:50,TSLA,0.3529,10000000 +2022-10-18 10:40,TSLA,0.3529,10000000 +2022-10-18 10:31,TSLA,0.3529,10000000 +2022-10-18 10:20,TSLA,0.3529,10000000 +2022-10-18 10:10,TSLA,0.3529,10000000 +2022-10-18 10:02,TSLA,0.3529,10000000 +2022-10-18 09:50,TSLA,0.3529,10000000 +2022-10-18 09:40,TSLA,0.3529,10000000 +2022-10-18 09:30,TSLA,0.3529,10000000 +2022-10-18 09:20,TSLA,0.3529,10000000 +2022-10-18 09:10,TSLA,0.3529,10000000 +2022-10-18 09:02,TSLA,0.3529,10000000 +2022-10-18 08:50,TSLA,0.3529,10000000 +2022-10-18 08:40,TSLA,0.3529,10000000 +2022-10-18 08:30,TSLA,0.3529,10000000 +2022-10-18 08:20,TSLA,0.3529,10000000 +2022-10-18 08:10,TSLA,0.25,10000000 +2022-10-18 08:01,TSLA,0.25,10000000 +2022-10-18 07:50,TSLA,0.25,10000000 +2022-10-18 07:40,TSLA,0.25,10000000 +2022-10-18 07:30,TSLA,0.25,10000000 +2022-10-18 07:21,TSLA,0.25,10000000 +2022-10-18 07:10,TSLA,0.25,10000000 +2022-10-18 07:02,TSLA,0.25,10000000 +2022-10-17 16:50,TSLA,0.25,10000000 +2022-10-17 16:40,TSLA,0.25,10000000 +2022-10-17 16:30,TSLA,0.25,10000000 +2022-10-17 16:20,TSLA,0.25,10000000 +2022-10-17 16:10,TSLA,0.25,10000000 +2022-10-17 16:02,TSLA,0.25,10000000 +2022-10-17 15:50,TSLA,0.25,10000000 +2022-10-17 15:41,TSLA,0.25,10000000 +2022-10-17 15:21,TSLA,0.25,10000000 +2022-10-17 15:11,TSLA,0.25,10000000 +2022-10-17 15:01,TSLA,0.25,10000000 +2022-10-17 14:50,TSLA,0.25,10000000 +2022-10-17 14:40,TSLA,0.25,10000000 +2022-10-17 14:31,TSLA,0.25,10000000 +2022-10-17 14:20,TSLA,0.25,10000000 +2022-10-17 14:10,TSLA,0.25,10000000 +2022-10-17 14:01,TSLA,0.25,10000000 +2022-10-17 13:50,TSLA,0.25,10000000 +2022-10-17 13:40,TSLA,0.25,10000000 +2022-10-17 13:31,TSLA,0.25,10000000 +2022-10-17 13:20,TSLA,0.25,10000000 +2022-10-17 13:10,TSLA,0.25,10000000 +2022-10-17 13:02,TSLA,0.25,10000000 +2022-10-17 12:50,TSLA,0.25,10000000 +2022-10-17 12:40,TSLA,0.25,10000000 +2022-10-17 12:30,TSLA,0.25,10000000 +2022-10-17 12:20,TSLA,0.25,10000000 +2022-10-17 12:10,TSLA,0.25,10000000 +2022-10-17 12:01,TSLA,0.25,10000000 +2022-10-17 11:40,TSLA,0.25,10000000 +2022-10-17 11:30,TSLA,0.25,10000000 +2022-10-17 11:20,TSLA,0.25,10000000 +2022-10-17 11:10,TSLA,0.25,10000000 +2022-10-17 11:01,TSLA,0.25,10000000 +2022-10-17 10:50,TSLA,0.25,10000000 +2022-10-17 10:40,TSLA,0.25,10000000 +2022-10-17 10:31,TSLA,0.25,10000000 +2022-10-17 10:20,TSLA,0.25,10000000 +2022-10-17 10:11,TSLA,0.25,10000000 +2022-10-17 10:01,TSLA,0.25,10000000 +2022-10-17 09:50,TSLA,0.25,10000000 +2022-10-17 09:40,TSLA,0.25,10000000 +2022-10-17 09:30,TSLA,0.25,10000000 +2022-10-17 09:20,TSLA,0.25,10000000 +2022-10-17 09:10,TSLA,0.25,10000000 +2022-10-17 09:02,TSLA,0.25,10000000 +2022-10-17 08:50,TSLA,0.25,10000000 +2022-10-17 08:40,TSLA,0.25,10000000 +2022-10-17 08:31,TSLA,0.25,10000000 +2022-10-17 08:20,TSLA,0.25,10000000 +2022-10-17 08:10,TSLA,0.25,10000000 +2022-10-17 08:01,TSLA,0.25,10000000 +2022-10-17 07:51,TSLA,0.25,10000000 +2022-10-17 07:40,TSLA,0.25,10000000 +2022-10-17 07:30,TSLA,0.25,10000000 +2022-10-17 07:20,TSLA,0.25,10000000 +2022-10-17 07:10,TSLA,0.25,10000000 +2022-10-17 07:02,TSLA,0.25,10000000 +2022-10-14 16:50,TSLA,0.25,10000000 +2022-10-14 16:40,TSLA,0.25,10000000 +2022-10-14 16:30,TSLA,0.25,10000000 +2022-10-14 16:20,TSLA,0.25,10000000 +2022-10-14 16:10,TSLA,0.25,10000000 +2022-10-14 16:02,TSLA,0.25,10000000 +2022-10-14 15:50,TSLA,0.25,10000000 +2022-10-14 15:40,TSLA,0.25,10000000 +2022-10-14 15:31,TSLA,0.25,10000000 +2022-10-14 15:20,TSLA,0.25,10000000 +2022-10-14 15:10,TSLA,0.2515,10000000 +2022-10-14 15:01,TSLA,0.2515,10000000 +2022-10-14 14:50,TSLA,0.2515,10000000 +2022-10-14 14:40,TSLA,0.2515,10000000 +2022-10-14 14:30,TSLA,0.2515,10000000 +2022-10-14 14:20,TSLA,0.2515,10000000 +2022-10-14 14:10,TSLA,0.2515,10000000 +2022-10-14 14:01,TSLA,0.2515,10000000 +2022-10-14 13:50,TSLA,0.2515,10000000 +2022-10-14 13:40,TSLA,0.2515,10000000 +2022-10-14 13:30,TSLA,0.2515,10000000 +2022-10-14 13:21,TSLA,0.2515,10000000 +2022-10-14 13:10,TSLA,0.25,10000000 +2022-10-14 13:02,TSLA,0.25,10000000 +2022-10-14 12:50,TSLA,0.25,10000000 +2022-10-14 12:40,TSLA,0.25,10000000 +2022-10-14 12:30,TSLA,0.25,10000000 +2022-10-14 12:20,TSLA,0.25,10000000 +2022-10-14 12:10,TSLA,0.25,10000000 +2022-10-14 12:01,TSLA,0.25,10000000 +2022-10-14 11:50,TSLA,0.25,10000000 +2022-10-14 11:40,TSLA,0.25,10000000 +2022-10-14 11:30,TSLA,0.25,10000000 +2022-10-14 11:20,TSLA,0.25,10000000 +2022-10-14 11:10,TSLA,0.25,10000000 +2022-10-14 11:01,TSLA,0.25,10000000 +2022-10-14 10:50,TSLA,0.25,10000000 +2022-10-14 10:40,TSLA,0.25,10000000 +2022-10-14 10:31,TSLA,0.25,10000000 +2022-10-14 10:20,TSLA,0.25,10000000 +2022-10-14 10:10,TSLA,0.25,10000000 +2022-10-14 10:02,TSLA,0.25,10000000 +2022-10-14 09:51,TSLA,0.25,10000000 +2022-10-14 09:40,TSLA,0.25,10000000 +2022-10-14 09:30,TSLA,0.25,10000000 +2022-10-14 09:20,TSLA,0.25,10000000 +2022-10-14 09:10,TSLA,0.25,10000000 +2022-10-14 09:02,TSLA,0.25,10000000 +2022-10-14 08:51,TSLA,0.25,10000000 +2022-10-14 08:40,TSLA,0.25,10000000 +2022-10-14 08:31,TSLA,0.25,10000000 +2022-10-14 08:20,TSLA,0.25,10000000 +2022-10-14 08:10,TSLA,0.25,10000000 +2022-10-14 08:01,TSLA,0.25,10000000 +2022-10-14 07:50,TSLA,0.25,10000000 +2022-10-14 07:40,TSLA,0.25,10000000 +2022-10-14 07:30,TSLA,0.25,10000000 +2022-10-14 07:20,TSLA,0.25,10000000 +2022-10-14 07:10,TSLA,0.25,10000000 +2022-10-14 07:02,TSLA,0.25,10000000 +2022-10-13 16:50,TSLA,0.25,10000000 +2022-10-13 16:41,TSLA,0.25,10000000 +2022-10-13 16:30,TSLA,0.25,10000000 +2022-10-13 16:20,TSLA,0.25,10000000 +2022-10-13 16:10,TSLA,0.25,10000000 +2022-10-13 16:02,TSLA,0.25,10000000 +2022-10-13 15:50,TSLA,0.25,10000000 +2022-10-13 15:40,TSLA,0.25,10000000 +2022-10-13 15:31,TSLA,0.25,10000000 +2022-10-13 15:20,TSLA,0.25,10000000 +2022-10-13 15:10,TSLA,0.25,10000000 +2022-10-13 15:01,TSLA,0.25,10000000 +2022-10-13 14:50,TSLA,0.25,10000000 +2022-10-13 14:40,TSLA,0.25,10000000 +2022-10-13 14:30,TSLA,0.25,10000000 +2022-10-13 14:20,TSLA,0.25,10000000 +2022-10-13 14:10,TSLA,0.25,10000000 +2022-10-13 14:01,TSLA,0.25,10000000 +2022-10-13 13:50,TSLA,0.25,10000000 +2022-10-13 13:41,TSLA,0.25,10000000 +2022-10-13 13:30,TSLA,0.25,10000000 +2022-10-13 13:20,TSLA,0.25,10000000 +2022-10-13 13:10,TSLA,0.25,10000000 +2022-10-13 13:02,TSLA,0.25,10000000 +2022-10-13 12:51,TSLA,0.25,10000000 +2022-10-13 12:41,TSLA,0.25,10000000 +2022-10-13 12:30,TSLA,0.25,10000000 +2022-10-13 12:20,TSLA,0.25,10000000 +2022-10-13 12:10,TSLA,0.25,10000000 +2022-10-13 12:01,TSLA,0.25,10000000 +2022-10-13 11:50,TSLA,0.25,10000000 +2022-10-13 11:40,TSLA,0.25,10000000 +2022-10-13 11:30,TSLA,0.25,10000000 +2022-10-13 11:20,TSLA,0.25,10000000 +2022-10-13 11:10,TSLA,0.25,10000000 +2022-10-13 11:01,TSLA,0.25,10000000 +2022-10-13 10:50,TSLA,0.25,10000000 +2022-10-13 10:40,TSLA,0.25,10000000 +2022-10-13 10:31,TSLA,0.25,10000000 +2022-10-13 10:20,TSLA,0.25,10000000 +2022-10-13 10:10,TSLA,0.25,10000000 +2022-10-13 10:02,TSLA,0.25,10000000 +2022-10-13 09:50,TSLA,0.25,10000000 +2022-10-13 09:40,TSLA,0.25,10000000 +2022-10-13 09:30,TSLA,0.25,10000000 +2022-10-13 09:20,TSLA,0.25,10000000 +2022-10-13 09:10,TSLA,0.25,10000000 +2022-10-13 08:50,TSLA,0.25,10000000 +2022-10-13 08:41,TSLA,0.25,10000000 +2022-10-13 08:30,TSLA,0.25,10000000 +2022-10-13 08:20,TSLA,0.25,10000000 +2022-10-13 08:10,TSLA,0.2596,10000000 +2022-10-13 08:01,TSLA,0.2596,10000000 +2022-10-13 07:51,TSLA,0.2596,10000000 +2022-10-13 07:40,TSLA,0.2596,10000000 +2022-10-13 07:30,TSLA,0.2596,10000000 +2022-10-13 07:20,TSLA,0.2596,10000000 +2022-10-13 07:10,TSLA,0.2596,10000000 +2022-10-13 07:01,TSLA,0.2596,10000000 +2022-10-12 16:50,TSLA,0.2596,10000000 +2022-10-12 16:40,TSLA,0.2596,10000000 +2022-10-12 16:31,TSLA,0.2596,10000000 +2022-10-12 16:20,TSLA,0.2596,10000000 +2022-10-12 16:10,TSLA,0.2603,10000000 +2022-10-12 16:02,TSLA,0.2603,10000000 +2022-10-12 15:50,TSLA,0.2603,10000000 +2022-10-12 15:40,TSLA,0.2603,10000000 +2022-10-12 15:31,TSLA,0.2603,10000000 +2022-10-12 15:20,TSLA,0.2603,10000000 +2022-10-12 15:10,TSLA,0.2661,10000000 +2022-10-12 15:01,TSLA,0.2661,10000000 +2022-10-12 14:50,TSLA,0.2661,10000000 +2022-10-12 14:40,TSLA,0.2661,10000000 +2022-10-12 14:30,TSLA,0.2661,10000000 +2022-10-12 14:20,TSLA,0.2661,10000000 +2022-10-12 14:10,TSLA,0.2661,10000000 +2022-10-12 14:01,TSLA,0.2661,10000000 +2022-10-12 13:50,TSLA,0.2661,10000000 +2022-10-12 13:40,TSLA,0.2661,10000000 +2022-10-12 13:31,TSLA,0.2661,10000000 +2022-10-12 13:20,TSLA,0.2661,10000000 +2022-10-12 13:10,TSLA,0.2769,10000000 +2022-10-12 13:02,TSLA,0.2769,10000000 +2022-10-12 12:50,TSLA,0.2769,10000000 +2022-10-12 12:40,TSLA,0.2769,10000000 +2022-10-12 12:31,TSLA,0.2769,10000000 +2022-10-12 12:20,TSLA,0.2769,10000000 +2022-10-12 12:10,TSLA,0.2769,10000000 +2022-10-12 12:01,TSLA,0.2769,10000000 +2022-10-12 11:50,TSLA,0.2769,10000000 +2022-10-12 11:40,TSLA,0.2769,10000000 +2022-10-12 11:30,TSLA,0.2769,10000000 +2022-10-12 11:20,TSLA,0.2769,10000000 +2022-10-12 11:10,TSLA,0.2771,10000000 +2022-10-12 11:01,TSLA,0.2771,10000000 +2022-10-12 10:50,TSLA,0.2771,10000000 +2022-10-12 10:40,TSLA,0.2771,10000000 +2022-10-12 10:31,TSLA,0.2771,10000000 +2022-10-12 10:20,TSLA,0.2771,10000000 +2022-10-12 10:10,TSLA,0.2771,10000000 +2022-10-12 10:01,TSLA,0.2771,10000000 +2022-10-12 09:50,TSLA,0.2771,10000000 +2022-10-12 09:40,TSLA,0.2771,10000000 +2022-10-12 09:30,TSLA,0.2771,10000000 +2022-10-12 09:20,TSLA,0.2771,10000000 +2022-10-12 09:10,TSLA,0.2771,10000000 +2022-10-12 09:02,TSLA,0.2771,10000000 +2022-10-12 08:50,TSLA,0.2771,10000000 +2022-10-12 08:41,TSLA,0.2771,10000000 +2022-10-12 08:31,TSLA,0.2771,10000000 +2022-10-12 08:20,TSLA,0.2771,10000000 +2022-10-12 08:10,TSLA,0.2539,10000000 +2022-10-12 08:01,TSLA,0.2539,10000000 +2022-10-12 07:50,TSLA,0.2539,10000000 +2022-10-12 07:40,TSLA,0.2539,10000000 +2022-10-12 07:30,TSLA,0.2539,10000000 +2022-10-12 07:20,TSLA,0.2539,10000000 +2022-10-12 07:11,TSLA,0.2539,10000000 +2022-10-12 07:02,TSLA,0.2539,10000000 +2022-10-11 16:50,TSLA,0.2539,10000000 +2022-10-11 16:40,TSLA,0.2539,10000000 +2022-10-11 16:31,TSLA,0.2539,10000000 +2022-10-11 16:21,TSLA,0.2539,10000000 +2022-10-11 16:10,TSLA,0.25,10000000 +2022-10-11 16:02,TSLA,0.25,10000000 +2022-10-11 15:50,TSLA,0.25,10000000 +2022-10-11 15:41,TSLA,0.25,10000000 +2022-10-11 15:31,TSLA,0.25,10000000 +2022-10-11 15:20,TSLA,0.25,10000000 +2022-10-11 15:10,TSLA,0.25,10000000 +2022-10-11 15:02,TSLA,0.25,10000000 +2022-10-11 14:50,TSLA,0.25,10000000 +2022-10-11 14:41,TSLA,0.25,10000000 +2022-10-11 14:31,TSLA,0.25,10000000 +2022-10-11 14:20,TSLA,0.25,10000000 +2022-10-11 14:10,TSLA,0.25,10000000 +2022-10-11 14:01,TSLA,0.25,10000000 +2022-10-11 13:50,TSLA,0.25,10000000 +2022-10-11 13:41,TSLA,0.25,10000000 +2022-10-11 13:31,TSLA,0.25,10000000 +2022-10-11 13:20,TSLA,0.25,10000000 +2022-10-11 13:10,TSLA,0.25,10000000 +2022-10-11 13:02,TSLA,0.25,10000000 +2022-10-11 12:50,TSLA,0.25,10000000 +2022-10-11 12:41,TSLA,0.25,10000000 +2022-10-11 12:31,TSLA,0.25,10000000 +2022-10-11 12:20,TSLA,0.25,10000000 +2022-10-11 12:10,TSLA,0.25,10000000 +2022-10-11 12:01,TSLA,0.25,10000000 +2022-10-11 11:50,TSLA,0.25,10000000 +2022-10-11 11:41,TSLA,0.25,10000000 +2022-10-11 11:31,TSLA,0.25,10000000 +2022-10-11 11:20,TSLA,0.25,10000000 +2022-10-11 11:10,TSLA,0.25,10000000 +2022-10-11 11:01,TSLA,0.25,10000000 +2022-10-11 10:50,TSLA,0.25,10000000 +2022-10-11 10:40,TSLA,0.25,10000000 +2022-10-11 10:31,TSLA,0.25,10000000 +2022-10-11 10:20,TSLA,0.25,10000000 +2022-10-11 10:10,TSLA,0.25,10000000 +2022-10-11 10:01,TSLA,0.25,10000000 +2022-10-11 09:50,TSLA,0.25,10000000 +2022-10-11 09:40,TSLA,0.25,10000000 +2022-10-11 09:31,TSLA,0.25,10000000 +2022-10-11 09:20,TSLA,0.25,10000000 +2022-10-11 09:10,TSLA,0.25,10000000 +2022-10-11 09:02,TSLA,0.25,10000000 +2022-10-11 08:50,TSLA,0.25,10000000 +2022-10-11 08:40,TSLA,0.25,10000000 +2022-10-11 08:31,TSLA,0.25,10000000 +2022-10-11 08:20,TSLA,0.25,10000000 +2022-10-11 08:10,TSLA,0.25,10000000 +2022-10-11 08:01,TSLA,0.25,10000000 +2022-10-11 07:50,TSLA,0.25,10000000 +2022-10-11 07:40,TSLA,0.25,10000000 +2022-10-11 07:30,TSLA,0.25,10000000 +2022-10-11 07:20,TSLA,0.25,10000000 +2022-10-11 07:10,TSLA,0.25,10000000 +2022-10-11 07:01,TSLA,0.25,10000000 +2022-10-10 16:50,TSLA,0.25,10000000 +2022-10-10 16:40,TSLA,0.25,10000000 +2022-10-10 16:31,TSLA,0.25,10000000 +2022-10-10 16:20,TSLA,0.25,10000000 +2022-10-10 16:10,TSLA,0.25,10000000 +2022-10-10 16:02,TSLA,0.25,10000000 +2022-10-10 15:50,TSLA,0.25,10000000 +2022-10-10 15:40,TSLA,0.25,10000000 +2022-10-10 15:31,TSLA,0.25,10000000 +2022-10-10 15:20,TSLA,0.25,10000000 +2022-10-10 15:10,TSLA,0.25,10000000 +2022-10-10 15:01,TSLA,0.25,10000000 +2022-10-10 14:50,TSLA,0.25,10000000 +2022-10-10 14:40,TSLA,0.25,10000000 +2022-10-10 14:30,TSLA,0.25,10000000 +2022-10-10 14:20,TSLA,0.25,10000000 +2022-10-10 14:10,TSLA,0.25,10000000 +2022-10-10 14:01,TSLA,0.25,10000000 +2022-10-10 13:50,TSLA,0.25,10000000 +2022-10-10 13:40,TSLA,0.25,10000000 +2022-10-10 13:31,TSLA,0.25,10000000 +2022-10-10 13:20,TSLA,0.25,10000000 +2022-10-10 13:10,TSLA,0.25,10000000 +2022-10-10 13:01,TSLA,0.25,10000000 +2022-10-10 12:50,TSLA,0.25,10000000 +2022-10-10 12:40,TSLA,0.25,10000000 +2022-10-10 12:30,TSLA,0.25,10000000 +2022-10-10 12:20,TSLA,0.25,10000000 +2022-10-10 12:10,TSLA,0.25,10000000 +2022-10-10 12:01,TSLA,0.25,10000000 +2022-10-10 11:50,TSLA,0.25,10000000 +2022-10-10 11:40,TSLA,0.25,10000000 +2022-10-10 11:30,TSLA,0.25,10000000 +2022-10-10 11:20,TSLA,0.25,10000000 +2022-10-10 11:10,TSLA,0.25,10000000 +2022-10-10 11:01,TSLA,0.25,10000000 +2022-10-10 10:50,TSLA,0.25,10000000 +2022-10-10 10:40,TSLA,0.25,10000000 +2022-10-10 10:31,TSLA,0.25,10000000 +2022-10-10 10:20,TSLA,0.25,10000000 +2022-10-10 10:10,TSLA,0.25,10000000 +2022-10-10 10:01,TSLA,0.25,10000000 +2022-10-10 09:50,TSLA,0.25,10000000 +2022-10-10 09:40,TSLA,0.25,10000000 +2022-10-10 09:30,TSLA,0.25,10000000 +2022-10-10 09:20,TSLA,0.25,10000000 +2022-10-10 09:10,TSLA,0.25,10000000 +2022-10-10 09:02,TSLA,0.25,10000000 +2022-10-10 08:50,TSLA,0.25,10000000 +2022-10-10 08:40,TSLA,0.25,10000000 +2022-10-10 08:30,TSLA,0.25,10000000 +2022-10-10 08:20,TSLA,0.25,10000000 +2022-10-10 08:10,TSLA,0.25,10000000 +2022-10-10 08:01,TSLA,0.25,10000000 +2022-10-10 07:50,TSLA,0.25,10000000 +2022-10-10 07:40,TSLA,0.25,10000000 +2022-10-10 07:30,TSLA,0.25,10000000 +2022-10-10 07:20,TSLA,0.25,10000000 +2022-10-10 07:10,TSLA,0.25,10000000 +2022-10-10 07:01,TSLA,0.25,10000000 +2022-10-07 16:50,TSLA,0.25,10000000 +2022-10-07 16:40,TSLA,0.25,10000000 +2022-10-07 16:31,TSLA,0.25,10000000 +2022-10-07 16:20,TSLA,0.25,10000000 +2022-10-07 16:10,TSLA,0.25,10000000 +2022-10-07 16:02,TSLA,0.25,10000000 +2022-10-07 15:50,TSLA,0.25,10000000 +2022-10-07 15:40,TSLA,0.25,10000000 +2022-10-07 15:31,TSLA,0.25,10000000 +2022-10-07 15:20,TSLA,0.25,10000000 +2022-10-07 15:11,TSLA,0.25,10000000 +2022-10-07 14:50,TSLA,0.25,10000000 +2022-10-07 14:40,TSLA,0.25,10000000 +2022-10-07 14:31,TSLA,0.25,10000000 +2022-10-07 14:20,TSLA,0.25,10000000 +2022-10-07 14:10,TSLA,0.25,10000000 +2022-10-07 14:01,TSLA,0.25,10000000 +2022-10-07 13:50,TSLA,0.25,10000000 +2022-10-07 13:40,TSLA,0.25,10000000 +2022-10-07 13:31,TSLA,0.25,10000000 +2022-10-07 13:20,TSLA,0.25,10000000 +2022-10-07 13:10,TSLA,0.25,10000000 +2022-10-07 13:01,TSLA,0.25,10000000 +2022-10-07 12:50,TSLA,0.25,10000000 +2022-10-07 12:40,TSLA,0.25,10000000 +2022-10-07 12:31,TSLA,0.25,10000000 +2022-10-07 12:20,TSLA,0.25,10000000 +2022-10-07 12:10,TSLA,0.25,10000000 +2022-10-07 12:01,TSLA,0.25,10000000 +2022-10-07 11:50,TSLA,0.25,10000000 +2022-10-07 11:40,TSLA,0.25,10000000 +2022-10-07 11:31,TSLA,0.25,10000000 +2022-10-07 11:20,TSLA,0.25,10000000 +2022-10-07 11:10,TSLA,0.25,10000000 +2022-10-07 11:01,TSLA,0.25,10000000 +2022-10-07 10:50,TSLA,0.25,10000000 +2022-10-07 10:40,TSLA,0.25,10000000 +2022-10-07 10:31,TSLA,0.25,10000000 +2022-10-07 10:20,TSLA,0.25,10000000 +2022-10-07 10:10,TSLA,0.25,10000000 +2022-10-07 10:01,TSLA,0.25,10000000 +2022-10-07 09:50,TSLA,0.25,10000000 +2022-10-07 09:40,TSLA,0.25,10000000 +2022-10-07 09:31,TSLA,0.25,10000000 +2022-10-07 09:20,TSLA,0.25,10000000 +2022-10-07 09:10,TSLA,0.25,10000000 +2022-10-07 09:02,TSLA,0.25,10000000 +2022-10-07 08:50,TSLA,0.25,10000000 +2022-10-07 08:40,TSLA,0.25,10000000 +2022-10-07 08:31,TSLA,0.25,10000000 +2022-10-07 08:20,TSLA,0.25,10000000 +2022-10-07 08:10,TSLA,0.25,10000000 +2022-10-07 08:01,TSLA,0.25,10000000 +2022-10-07 07:50,TSLA,0.25,10000000 +2022-10-07 07:40,TSLA,0.25,10000000 +2022-10-07 07:30,TSLA,0.25,10000000 +2022-10-07 07:20,TSLA,0.25,10000000 +2022-10-07 07:10,TSLA,0.25,10000000 +2022-10-07 07:01,TSLA,0.25,10000000 +2022-10-06 16:50,TSLA,0.25,10000000 +2022-10-06 16:40,TSLA,0.25,10000000 +2022-10-06 16:30,TSLA,0.25,10000000 +2022-10-06 16:20,TSLA,0.25,10000000 +2022-10-06 16:10,TSLA,0.25,10000000 +2022-10-06 16:01,TSLA,0.25,10000000 +2022-10-06 15:50,TSLA,0.25,10000000 +2022-10-06 15:40,TSLA,0.25,10000000 +2022-10-06 15:31,TSLA,0.25,10000000 +2022-10-06 15:20,TSLA,0.25,10000000 +2022-10-06 15:10,TSLA,0.25,10000000 +2022-10-06 15:01,TSLA,0.25,10000000 +2022-10-06 14:50,TSLA,0.25,10000000 +2022-10-06 14:40,TSLA,0.25,10000000 +2022-10-06 14:30,TSLA,0.25,10000000 +2022-10-06 14:20,TSLA,0.25,10000000 +2022-10-06 14:10,TSLA,0.25,10000000 +2022-10-06 14:01,TSLA,0.25,10000000 +2022-10-06 13:50,TSLA,0.25,10000000 +2022-10-06 13:40,TSLA,0.25,10000000 +2022-10-06 13:30,TSLA,0.25,10000000 +2022-10-06 13:20,TSLA,0.25,10000000 +2022-10-06 13:10,TSLA,0.25,10000000 +2022-10-06 13:01,TSLA,0.25,10000000 +2022-10-06 12:50,TSLA,0.25,10000000 +2022-10-06 12:40,TSLA,0.25,10000000 +2022-10-06 12:30,TSLA,0.25,10000000 +2022-10-06 12:20,TSLA,0.25,10000000 +2022-10-06 12:10,TSLA,0.25,10000000 +2022-10-06 12:01,TSLA,0.25,10000000 +2022-10-06 11:50,TSLA,0.25,10000000 +2022-10-06 11:40,TSLA,0.25,10000000 +2022-10-06 11:30,TSLA,0.25,10000000 +2022-10-06 11:20,TSLA,0.25,10000000 +2022-10-06 11:10,TSLA,0.25,10000000 +2022-10-06 11:01,TSLA,0.25,10000000 +2022-10-06 10:50,TSLA,0.25,10000000 +2022-10-06 10:40,TSLA,0.25,10000000 +2022-10-06 10:39,TSLA,0.25,10000000 diff --git a/tests/openbb_terminal/stocks/dark_pool_shorts/test_stocksera_model.py b/tests/openbb_terminal/stocks/dark_pool_shorts/test_stocksera_model.py new file mode 100644 index 00000000000..904fc5712ca --- /dev/null +++ b/tests/openbb_terminal/stocks/dark_pool_shorts/test_stocksera_model.py @@ -0,0 +1,14 @@ +# IMPORTATION STANDARD + +# IMPORTATION THIRDPARTY +import pytest + +# IMPORTATION INTERNAL +from openbb_terminal.stocks.dark_pool_shorts import stocksera_model + + +@pytest.mark.vcr +def test_get_cost_to_borrow(recorder): + result_df = stocksera_model.get_cost_to_borrow("TSLA") + + recorder.capture(result_df) diff --git a/tests/openbb_terminal/stocks/dark_pool_shorts/test_stocksera_view.py b/tests/openbb_terminal/stocks/dark_pool_shorts/test_stocksera_view.py new file mode 100644 index 00000000000..ff4adcae979 --- /dev/null +++ b/tests/openbb_terminal/stocks/dark_pool_shorts/test_stocksera_view.py @@ -0,0 +1,19 @@ +# IMPORTATION STANDARD + +# IMPORTATION THIRDPARTY +import pytest +import pandas as pd + +# IMPORTATION INTERNAL +from openbb_terminal.stocks.dark_pool_shorts import stocksera_view + + +@pytest.mark.vcr +def test_plot_cost_to_borrow(): + df = pd.DataFrame() + stocksera_view.plot_cost_to_borrow("TSLA", df) + + +@pytest.mark.vcr +def test_cost_to_borrow(): + stocksera_view.cost_to_borrow("TSLA") diff --git a/tests/openbb_terminal/stocks/dark_pool_shorts/txt/test_dps_controller/test_print_help.txt b/tests/openbb_terminal/stocks/dark_pool_shorts/txt/test_dps_controller/test_print_help.txt index 7c5af2708a2..bf58e44dbe4 100644 --- a/tests/openbb_terminal/stocks/dark_pool_shorts/txt/test_dps_controller/test_print_help.txt +++ b/tests/openbb_terminal/stocks/dark_pool_shorts/txt/test_dps_controller/test_print_help.txt @@ -1,7 +1,7 @@ load load a specific stock ticker for analysis [YahooFinance, IEXCloud, AlphaVantage, Polygon, EODHD] shorted show most shorted stocks [YahooFinance] - ctb stocks with highest cost to borrow [InteractiveBrokers] + ctb cost to borrow of stocks [ibkr, stocksera] hsi show top high short interest stocks of over 20% ratio [Shortinterest] prom promising tickers based on dark pool shares regression [FINRA] pos dark pool short position [Stockgrid] diff --git a/website/content/terminal/stocks/dps/ctb/_index.md b/website/content/terminal/stocks/dps/ctb/_index.md index d52567a5fc1..34cce77f1dd 100644 --- a/website/content/terminal/stocks/dps/ctb/_index.md +++ b/website/content/terminal/stocks/dps/ctb/_index.md @@ -6,10 +6,13 @@ Request a list of stocks that have the highest cost to borrow [Source: Interacti ``` optional arguments: - -n NUM, --num NUM Number of the stocks with high cost to borrow to retrieve. (default: 20) - --export {csv,json,xlsx} - Export dataframe data to csv,json,xlsx file + -n NUMBER, --number NUMBER + Number of records to retrieve. (default: 20) + --raw Print raw data. (default: False) -h, --help show this help message (default: False) + --export EXPORT Export raw data into csv, json, xlsx (default: ) + --source {ibkr,stocksera} + Data source to select from (default: ibkr) ``` Example: