mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-12 12:22:35 +00:00
add + update readme + linting
This commit is contained in:
@@ -44,7 +44,7 @@ usage: ema_cross [-l] [-s] [--spy] [--no_bench] [--no_short]
|
||||
im
|
||||
### RSI <a name="RSI"></a>
|
||||
This strategy goes long when the RSI is "oversold" - defined as the low parameter. It goes short when
|
||||
the RSI is "overbought" - defined as the high (upper) paramter
|
||||
the RSI is "overbought" - defined as the high (upper) parameter
|
||||
````
|
||||
usage: rsi [-u] [-l] [-p] [--spy] [--no_bench] [--no_short]
|
||||
````
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""bt view module"""
|
||||
__docformat__ = "numpy"
|
||||
import argparse
|
||||
from typing import List
|
||||
from typing import List, Union
|
||||
from datetime import datetime
|
||||
import matplotlib.pyplot as plt
|
||||
import pandas as pd
|
||||
@@ -13,7 +13,7 @@ from gamestonk_terminal import feature_flags as gtff
|
||||
from gamestonk_terminal.backtesting.bt_helper import buy_and_hold
|
||||
|
||||
|
||||
def simple_ema(ticker: str, start_date: datetime, other_args: List[str]):
|
||||
def simple_ema(ticker: str, start_date: Union[str, datetime], other_args: List[str]):
|
||||
|
||||
parser = argparse.ArgumentParser(add_help=False, prog="ema")
|
||||
parser.add_argument(
|
||||
@@ -87,7 +87,7 @@ def simple_ema(ticker: str, start_date: datetime, other_args: List[str]):
|
||||
return
|
||||
|
||||
|
||||
def ema_cross(ticker: str, start_date: datetime, other_args: List[str]):
|
||||
def ema_cross(ticker: str, start_date: Union[str, datetime], other_args: List[str]):
|
||||
parser = argparse.ArgumentParser(add_help=False, prog="ema_cross")
|
||||
parser.add_argument(
|
||||
"-l", "--long", default=50, dest="long", type=int, help="Long EMA period"
|
||||
@@ -185,7 +185,7 @@ def ema_cross(ticker: str, start_date: datetime, other_args: List[str]):
|
||||
return
|
||||
|
||||
|
||||
def rsi_strat(ticker: str, start_date: datetime, other_args: List[str]):
|
||||
def rsi_strat(ticker: str, start_date: Union[datetime, str], other_args: List[str]):
|
||||
parser = argparse.ArgumentParser(add_help=False, prog="rsi_strat")
|
||||
parser.add_argument(
|
||||
"-p",
|
||||
@@ -240,7 +240,7 @@ def rsi_strat(ticker: str, start_date: datetime, other_args: List[str]):
|
||||
rsi = pd.DataFrame(ta.rsi(prices[ticker], ns_parser.periods))
|
||||
rsi.columns = [ticker]
|
||||
|
||||
signal = 0*rsi.copy()
|
||||
signal = 0 * rsi.copy()
|
||||
signal[rsi > ns_parser.high] = -1
|
||||
signal[rsi < ns_parser.low] = 1
|
||||
signal[rsi.isnull()] = 0
|
||||
|
||||
@@ -48,7 +48,7 @@ TRADIER_TOKEN = os.getenv("GT_TRADIER_TOKEN") or "REPLACE_ME"
|
||||
|
||||
# Selenium Webbrowser drivers can be found at https://selenium-python.readthedocs.io/installation.html
|
||||
WEBDRIVER_TO_USE = "chrome"
|
||||
PATH_TO_SELENIUM_DRIVER = None # Replace with "PATH"
|
||||
PATH_TO_SELENIUM_DRIVER = None # Replace with "PATH"
|
||||
|
||||
# https://coinmarketcap.com/api/
|
||||
COINMARKETCAP_KEY = os.getenv("GT_CMC_API_KEY") or "REPLACE_ME"
|
||||
|
||||
Reference in New Issue
Block a user