Fix view command, that was reloading tickers

This commit is contained in:
didier
2021-04-10 23:16:26 +01:00
parent 987618472b
commit 9fd6445271
2 changed files with 2 additions and 19 deletions

View File

@@ -369,24 +369,6 @@ def view(l_args, s_ticker, s_start, s_interval, df_stock):
type_candles = lett_to_num(ns_parser.type)
try:
ts = TimeSeries(key=cfg.API_KEY_ALPHAVANTAGE, output_format="pandas")
# Daily
if s_interval == "1440min":
# pylint: disable=unbalanced-tuple-unpacking
df_stock, _ = ts.get_daily_adjusted(symbol=s_ticker, outputsize="full")
# Intraday
else:
# pylint: disable=unbalanced-tuple-unpacking
df_stock, _ = ts.get_intraday(
symbol=s_ticker, outputsize="full", interval=s_interval
)
except Exception as e:
print(e)
print("Either the ticker or the API_KEY are invalids. Try again!")
return
df_stock.sort_index(ascending=True, inplace=True)
# Slice dataframe from the starting date YYYY-MM-DD selected

View File

@@ -177,7 +177,8 @@ def main():
else:
print(
"No ticker selected. Use 'load ticker' to load the ticker you want to look at."
"No ticker selected. Use 'load ticker' to load the ticker you want to look at.",
"\n"
)
main_cmd = True