Skip to content

Commit

Permalink
Fix spelling and add missing thepassiveinvestor (OpenBB-finance#925)
Browse files Browse the repository at this point in the history
* Fix spelling and add missing thepassiveinvestor

* Updating strike and tickers
  • Loading branch information
aia authored Nov 6, 2021
1 parent f3a817f commit 068f22d
Show file tree
Hide file tree
Showing 33 changed files with 79 additions and 56 deletions.
4 changes: 2 additions & 2 deletions gamestonk_terminal/common/technical_analysis/overlap_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ def view_vwap(
)

s = mpf.make_mpf_style(marketcolors=mc, gridstyle=":", y_on_right=True)
apdict = mpf.make_addplot(df_vwap, color="k")
addplot_result = mpf.make_addplot(df_vwap, color="k")

mpf.plot(
day_df,
style=s,
type="candle",
addplot=apdict,
addplot=addplot_result,
volume=True,
title=f"\n{s_ticker} {s_interval} VWAP",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def adx(s_interval: str, df_stock: pd.DataFrame, length: int, scalar: int, drift
Length of window
scalar: int
Scalar variable
droft: int
drift: int
Drift variable
Returns
Expand Down
4 changes: 2 additions & 2 deletions gamestonk_terminal/common/technical_analysis/volume_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def ad(df_stock: pd.DataFrame, use_open: bool) -> pd.DataFrame:
Returns
-------
pd.DataFrame
Dataframe with techinical indicator
Dataframe with technical indicator
"""
if use_open:
df_ta = ta.ad(
Expand Down Expand Up @@ -89,7 +89,7 @@ def obv(s_interval: str, df_stock: pd.DataFrame) -> pd.DataFrame:
Returns
-------
pd.DataFrame
Dataframe with techinical indicator
Dataframe with technical indicator
"""
# Daily
if s_interval == "1440min":
Expand Down
4 changes: 2 additions & 2 deletions gamestonk_terminal/common/technical_analysis/volume_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
def plot_ad(
s_ticker: str, s_interval: str, df_stock: pd.DataFrame, use_open: bool, export: str
):
"""Plot AD tecnhical inticator
"""Plot AD technical indicator
Parameters
----------
Expand Down Expand Up @@ -214,7 +214,7 @@ def plot_adosc(


def plot_obv(s_ticker: str, s_interval: str, df_stock: pd.DataFrame, export: str):
"""Plot OBV tecnhical inticator
"""Plot OBV technical indicator
Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions gamestonk_terminal/cryptocurrency/defi/llama_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_defi_protocols() -> pd.DataFrame:
"description",
]
if response.status_code != 200:
raise Exception(f"Status code: {response.status_code}. Resason {response.text}")
raise Exception(f"Status code: {response.status_code}. Reason: {response.text}")
try:
df = pd.DataFrame(response.json())
df.replace({float(np.nan): None}, inplace=True)
Expand All @@ -59,7 +59,7 @@ def get_defi_tvl() -> pd.DataFrame:
"""
response = requests.get("https://api.llama.fi/charts")
if response.status_code != 200:
raise Exception(f"Status code: {response.status_code}. Resason {response.text}")
raise Exception(f"Status code: {response.status_code}. Reason: {response.text}")
try:
df = pd.DataFrame(response.json())
df["date"] = df["date"].apply(lambda x: datetime.fromtimestamp(int(x)).date())
Expand Down
6 changes: 6 additions & 0 deletions gamestonk_terminal/economy/alphavantage_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,15 @@ def display_unemployment(start_year: int = 2015, raw: bool = False, export: str
export : str, optional
Format to export data, by default ""
"""

unemp = alphavantage_model.get_unemployment()

if unemp.empty:
print("Error getting data. Check API Key")
return

un = unemp[unemp.date >= f"{start_year}-01-01"]

fig, ax = plt.subplots(figsize=plot_autoscale(), dpi=cfp.PLOT_DPI)
ax.plot(un.date, un.unemp, marker="o", c="dodgerblue")
ax.set_xlabel("Date")
Expand All @@ -360,6 +364,7 @@ def display_unemployment(start_year: int = 2015, raw: bool = False, export: str
"unemp",
unemp,
)

if raw:
if gtff.USE_TABULATE_DF:
print(
Expand All @@ -372,4 +377,5 @@ def display_unemployment(start_year: int = 2015, raw: bool = False, export: str
)
else:
print(un.head(20).to_string())

print("")
2 changes: 1 addition & 1 deletion gamestonk_terminal/economy/finnhub_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def economy_calendar_events(country: str, num: int, impact: str, export: str):

if df_econ_calendar.empty:
print(
"No latet economy calendar events found in the specified country with this impact\n"
"No latest economy calendar events found in the specified country with this impact\n"
)
return

Expand Down
2 changes: 2 additions & 0 deletions gamestonk_terminal/economy/fred_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ def get_series_notes(series_term: str, num: int) -> str:
notes : str
Series notes output
"""

fred.key(cfg.API_FRED_KEY)
d_series = fred.search(series_term)

if "seriess" not in d_series:
return "No Series found using this term!\n"

Expand Down
10 changes: 5 additions & 5 deletions gamestonk_terminal/economy/fred_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ def display_series(series: str, start_date: str, raw: bool, export: str):
success_series = []
success_titles = []

for serie_term in series.split(","):
if serie_term:
l_series, l_title = fred_model.get_series_ids(serie_term, 5)
for series_term in series.split(","):
if series_term:
l_series, l_title = fred_model.get_series_ids(series_term, 5)

if len(l_series) == 0:
print(f"No series found for term '{serie_term}'\n")
print(f"No series found for term '{series_term}'\n")
continue

print(f"For '{serie_term}', series IDs found: {', '.join(l_series)}.\n")
print(f"For '{series_term}', series IDs found: {', '.join(l_series)}.\n")

ser = l_series[0]
ser_title = l_title[0]
Expand Down
2 changes: 1 addition & 1 deletion gamestonk_terminal/options/chartexchange_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def display_raw(
call : bool
Whether the underlying asset should be a call or a put
price : float
The stike of the expiration
The strike of the expiration
num : int
Number of rows to show
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def display_orders(limit: int, sortby: str, descend: bool, export: str = "") ->


def display_deposits(
limit: int, sortby: str, deposite_type: str, descend: bool, export: str = ""
limit: int, sortby: str, deposit_type: str, descend: bool, export: str = ""
) -> None:
"""Display deposits into account [Source: Coinbase]
Expand All @@ -153,13 +153,13 @@ def display_deposits(
Key to sort by
descend: bool
Flag to sort descending
deposite_type: str
deposit_type: str
internal_deposits (transfer between portfolios) or deposit
export : str
Export dataframe data to csv,json,xlsx file
"""

df = coinbase_model.get_deposits(deposit_type=deposite_type)
df = coinbase_model.get_deposits(deposit_type=deposit_type)

if df.empty:
print("No deposits found for your account\n")
Expand Down
2 changes: 1 addition & 1 deletion gamestonk_terminal/portfolio/brokers/degiro/degiro_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def lookup(self, ns_parser: Namespace):
# GET ATTRIBUTES
degiro_model = self.__degiro_model

# FECTH DATA
# FETCH DATA
product_search = degiro_model.lookup(
limit=ns_parser.limit,
offset=ns_parser.offset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def load_portfolio(
Returns
-------
pd.DataFrame
Dataframe conataining portfolio
Dataframe containing portfolio
"""
if full_path.endswith(".csv"):
df = pd.read_csv(full_path)
Expand Down
2 changes: 1 addition & 1 deletion gamestonk_terminal/portfolio/portfolio_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def merge_dataframes(
A log of past transactions
divs : pd.DataFrame
The dividend history for stocks in portfolio
unqiues: List[str]
uniques: List[str]
A list of stocks in the portfolio
Returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import argparse

# These are all the possible yfinance properties
l_valid_property_infos = [
valid_property_infos = [
"previousClose",
"regularMarketOpen",
"twoHundredDayAverage",
Expand Down Expand Up @@ -99,9 +99,9 @@
]


def check_valid_property_type(aproperty: str) -> str:
def check_valid_property_type(check_property: str) -> str:
"""Check that the property selected is valid"""
if aproperty in l_valid_property_infos:
return aproperty
if check_property in valid_property_infos:
return check_property

raise argparse.ArgumentTypeError(f"{aproperty} is not a valid info")
raise argparse.ArgumentTypeError(f"{check_property} is not a valid info")
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_maxsharpe_portfolio(
def get_minvol_portfolio(
stocks: List[str], period: str = "3mo"
) -> Tuple[Dict, EfficientFrontier]:
"""Generate weights for minimum voltaility portfolio
"""Generate weights for minimum volatility portfolio
Parameters
----------
Expand All @@ -120,7 +120,7 @@ def get_maxquadutil_portfolio(
risk_aversion: float = 1.0,
market_neutral: bool = False,
) -> Tuple[Dict, EfficientFrontier]:
"""Get portfolio maximizing quadratic ultility at a given risk aversion
"""Get portfolio maximizing quadratic utility at a given risk aversion
Parameters
----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ def call_yolo(self, _):

@try_except
def add_stocks(self, other_args: List[str]):
"""Add ticker or Select tickes for portfolio to be optimized"""
"""Add ticker or Select tickers for portfolio to be optimized"""
parser = argparse.ArgumentParser(
add_help=False,
prog="add/select",
Expand Down
24 changes: 12 additions & 12 deletions gamestonk_terminal/portfolio/portfolio_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ def plot_overall_return(
print("")
return None

imgdata = BytesIO()
fig.savefig(imgdata, format="png")
imgdata.seek(0)
return ImageReader(imgdata)
image_data = BytesIO()
fig.savefig(image_data, format="png")
image_data.seek(0)
return ImageReader(image_data)


def plot_rolling_beta(df: pd.DataFrame) -> ImageReader:
Expand Down Expand Up @@ -183,10 +183,10 @@ def plot_rolling_beta(df: pd.DataFrame) -> ImageReader:
)
ax.set_facecolor("white")
fig.autofmt_xdate()
imgdata = BytesIO()
fig.savefig(imgdata, format="png")
imgdata.seek(0)
return ImageReader(imgdata)
image_data = BytesIO()
fig.savefig(image_data, format="png")
image_data.seek(0)
return ImageReader(image_data)


def plot_ef(
Expand Down Expand Up @@ -244,10 +244,10 @@ def plot_ef(
if gtff.USE_ION:
plt.ion()

imgdata = BytesIO()
fig.savefig(imgdata, format="png")
imgdata.seek(0)
return ImageReader(imgdata)
image_data = BytesIO()
fig.savefig(image_data, format="png")
image_data.seek(0)
return ImageReader(image_data)


class Report:
Expand Down
2 changes: 1 addition & 1 deletion gamestonk_terminal/stocks/backtesting/bt_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def rsi_strategy(
df_stock : pd.DataFrame
Dataframe of prices
periods : int
Number of periods for RSI calculati
Number of periods for RSI calculation
low_rsi : int
Low RSI value to buy
hirh_rsi : int
Expand Down
2 changes: 1 addition & 1 deletion gamestonk_terminal/stocks/backtesting/bt_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def display_rsi_strategy(
df_stock : pd.Dataframe
Dataframe of prices
periods : int
Number of periods for RSI calculati
Number of periods for RSI calculation
low_rsi : int
Low RSI value to buy
hirh_rsi : int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def call_getfinnhub(self, other_args: List[str]):
add_help=False,
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
prog="getfinnhub",
description="""Get similar companies from finnhubto compare with.""",
description="""Get similar companies from finnhub to compare with.""",
)
ns_parser = parse_known_args_and_warn(parser, other_args)
if not ns_parser:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_shareholders(ticker: str) -> Tuple[pd.DataFrame, pd.DataFrame, pd.DataFr
pd.DataFrame
Major holders
pd.DataFrame
Institutuional holders
Institutional holders
pd.DataFrame
Mutual Fund holders
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def display_sustainability(ticker: str):
)
)
else:
print(df_sustainability.to_sring(index=True))
print(df_sustainability.to_string(index=True))
print("")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def call_kurtosis(self, other_args: List[str]):
default="",
type=str,
dest="export",
help="Export dfframe df to csv,json,xlsx file",
help="Export data frame df to csv,json,xlsx file",
)
ns_parser = parse_known_args_and_warn(parser, other_args)
if not ns_parser:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_finviz_image(ticker: str) -> bytes:
Returns
-------
bytes
Image in byted format
Image in byte format
"""
stock = finvizfinance(ticker)
image_url = stock.TickerCharts(urlonly=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ def call_adosc(self, other_args: List[str]):
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
prog="adosc",
description="""
Acummulation/Distribution Oscillator, also known as the Chaikin Oscillator
Accumulation/Distribution Oscillator, also known as the Chaikin Oscillator
is essentially a momentum indicator, but of the Accumulation-Distribution line
rather than merely price. It looks at both the strength of price moves and the
underlying buying and selling pressure during a given time period. The oscillator
Expand Down
Loading

0 comments on commit 068f22d

Please sign in to comment.