Files
OpenBB/openbb_terminal/stocks/technical_analysis/rsp_model.py
Theodore Aptekarev 15d1870194 Reorganize project extras for a pip installable package (#3432)
* Re-solve the dependencies for optimization extras

* Remove unused reportlab helpers

* Update install from source and troubleshooting docs

* Fix typos found by cspell

* Prevent po menu from launching when optimization toolkit not installed

* Add optimization dependencies to default requirements.txt for the CI

* Add optimization toolkit installation to the CI

* Fix markdown linting

* Update CI test dependency installation for matrix tests

* Fix markdown linting

* Update source installation docs

* Clean up ToC in the main readme

* Update the SDK documentation

* Fix markdown linting after making readme sections linkable

* Fix more markdown linting

* Fix more markdown linting

* Update secrets detection with exclusion rules

* Bump detect-secrets configuration

* Tune secret detector

* Fix more markdown linting

* Add optimization toolkit install to installer GH actions

* Add optimization toolkit install to docker build

* Fix typos

* Add "all" extras setting to install torch and riskfolio

* Move forecasting dependencies to pyproject.toml

* Update CI build configs

* Update documentation to feature the "all" extra

* Lint markdown

* Update docs to specify requirement of having a C compiler

* Added log Id to codesigning steps in inteel Macos workflow

* Changed disk for the m1 macos build

* Changed disk for the m1 macos build

* Changed disk for the intel macos build

* taking out sigtool removal line

* Remove dev version number from pyproject.toml

* removing sigtool from all build steps

* changes to m1 build and commenting test_report_economy

* more m1 build changes

* testing exit on conda setup

* some more

* changing shell to bash to setup conda

* bash on lines

* bash on all lines

* small bash removals

* intel fix and test_crypto int test

* upgrading setupminiconda version

* adding back in intel conda init and reset

* intel removal of init

* taking bash back out from m1

* removing old codesign lines

* adding codesign specific binaries

* ssl fix for all terminal

* removing if installer

* various ssl fixes across commands

* fixing ssl mistake

* integration test changes

* Linting + remove comment

* Update poetry.lock

* Update requirements

* Update the docs to mention that PO is not working on arm arch

* Update deps to pin setuptools

* Disable reports on pyinstaller packaged version

* Update reports

* small grammar change for forecast report message

* Pin grpcio following introduced regression in 1.51.0

* Update docs to reflect changes in how optimization is installed

Co-authored-by: Luqman Bello <lb@Luqmans-MacBook-Pro.local>
Co-authored-by: James Simmons <simmonsj330@gmail.com>
Co-authored-by: James Simmons <53658028+simmonsj330@users.noreply.github.com>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
Co-authored-by: Chavithra <chavithra@gmail.com>
2022-11-22 12:33:59 -05:00

50 lines
1.5 KiB
Python

""" Relative Strength Percentile Model """
__docformat__ = "numpy"
import logging
from typing import Tuple
import pandas as pd
from openbb_terminal.decorators import log_start_end
logger = logging.getLogger(__name__)
@log_start_end(log=logger)
def get_rsp(
s_ticker: str = "",
) -> Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame, pd.DataFrame]:
"""Relative strength percentile [Source: https://github.com/skyte/relative-strength]
Currently takes from https://github.com/soggyomelette/rs-log in order to get desired output
Parameters
----------
s_ticker : str
Stock Ticker
Returns
-------
Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame, pd.DataFrame]
Dataframe of stock percentile, Dataframe of industry percentile,
Raw stock dataframe for export, Raw industry dataframe for export
"""
df_stock_p = pd.read_csv(
"https://raw.githubusercontent.com/soggyomelette/rs-log/main/output/rs_stocks.csv"
)
df_industries_p = pd.read_csv(
"https://raw.githubusercontent.com/soggyomelette/rs-log/main/output/rs_industries.csv"
)
rsp_stock = pd.DataFrame()
rsp_industry = pd.DataFrame()
if s_ticker != "":
rsp_stock = df_stock_p[df_stock_p["Ticker"].str.match(s_ticker)]
for i in range(len(df_industries_p)):
if s_ticker in df_industries_p.iloc[i]["Tickers"]:
rsp_industry = df_industries_p.iloc[[i]]
return (rsp_stock, rsp_industry, df_stock_p, df_industries_p) # type: ignore