mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
Improve research menu
This commit is contained in:
@@ -2,10 +2,16 @@ import argparse
|
||||
import webbrowser
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------------------------------------------------
|
||||
def print_research():
|
||||
def print_research(s_ticker, s_start, s_interval):
|
||||
""" Print help """
|
||||
|
||||
s_intraday = (f"Intraday {s_interval}", "Daily")[s_interval == "1440min"]
|
||||
|
||||
if s_start:
|
||||
print(f"\n{s_intraday} Stock: {s_ticker} (from {s_start.strftime('%Y-%m-%d')})")
|
||||
else:
|
||||
print(f"\n{s_intraday} Stock: {s_ticker}")
|
||||
|
||||
print("\nResearch Mode:")
|
||||
print(" help show this fundamental analysis menu again")
|
||||
print(" q quit this menu, and shows back to main menu")
|
||||
@@ -33,8 +39,7 @@ def print_research():
|
||||
print("")
|
||||
|
||||
|
||||
# ---------------------------------------------------- MENU ----------------------------------------------------
|
||||
def res_menu(s_ticker):
|
||||
def res_menu(s_ticker, s_start, s_interval):
|
||||
# Add list of arguments that the research parser accepts
|
||||
res_parser = argparse.ArgumentParser(prog="discovery", add_help=False)
|
||||
res_parser.add_argument(
|
||||
@@ -64,7 +69,7 @@ def res_menu(s_ticker):
|
||||
],
|
||||
)
|
||||
|
||||
print_research()
|
||||
print_research(s_ticker, s_start, s_interval)
|
||||
|
||||
# Loop forever and ever
|
||||
while True:
|
||||
@@ -80,7 +85,7 @@ def res_menu(s_ticker):
|
||||
|
||||
try:
|
||||
if ns_known_args.cmd == "help":
|
||||
print_research()
|
||||
print_research(s_ticker, s_start, s_interval)
|
||||
|
||||
elif ns_known_args.cmd == "q":
|
||||
# Just leave the RES menu
|
||||
@@ -90,116 +95,80 @@ def res_menu(s_ticker):
|
||||
# Abandon the program
|
||||
return True
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "macroaxis":
|
||||
webbrowser.open(f"https://www.macroaxis.com/invest/market/{s_ticker}")
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "yahoo":
|
||||
webbrowser.open(f"https://finance.yahoo.com/quote/{s_ticker}")
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "finviz":
|
||||
webbrowser.open(f"https://finviz.com/quote.ashx?t={s_ticker}")
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "marketwatch":
|
||||
webbrowser.open(
|
||||
f"https://www.marketwatch.com/investing/stock/{s_ticker}"
|
||||
)
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "fool":
|
||||
webbrowser.open(f"https://www.fool.com/quote/{s_ticker}")
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "businessinsider":
|
||||
webbrowser.open(
|
||||
f"https://markets.businessinsider.com/stocks/{s_ticker}-stock/"
|
||||
)
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "fmp":
|
||||
webbrowser.open(
|
||||
f"https://financialmodelingprep.com/financial-summary/{s_ticker}"
|
||||
)
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "fidelity":
|
||||
webbrowser.open(
|
||||
f"https://eresearch.fidelity.com/eresearch/goto/evaluate/snapshot.jhtml?symbols={s_ticker}"
|
||||
)
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "tradingview":
|
||||
webbrowser.open(f"https://www.tradingview.com/symbols/{s_ticker}")
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "marketchameleon":
|
||||
webbrowser.open(f"https://marketchameleon.com/Overview/{s_ticker}")
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "stockrow":
|
||||
webbrowser.open(f"https://stockrow.com/{s_ticker}")
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "barchart":
|
||||
webbrowser.open(
|
||||
f"https://www.barchart.com/stocks/quotes/{s_ticker}/overview"
|
||||
)
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "grufity":
|
||||
webbrowser.open(f"https://grufity.com/stock/{s_ticker}")
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "fintel":
|
||||
webbrowser.open(f"https://fintel.io/s/us/{s_ticker}")
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "zacks":
|
||||
webbrowser.open(f"https://www.zacks.com/stock/quote/{s_ticker}")
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "macrotrends":
|
||||
webbrowser.open(
|
||||
f"https://www.macrotrends.net/stocks/charts/{s_ticker}/{s_ticker}/market-cap"
|
||||
)
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "newsfilter":
|
||||
webbrowser.open(f"https://newsfilter.io/search?query={s_ticker}")
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
elif ns_known_args.cmd == "resources":
|
||||
# webbrowser.open(f"https://www.tradinganalysisresources.com/2020/05/free-references-and-resources.html")
|
||||
webbrowser.open(
|
||||
"https://moongangcapital.com/free-stock-market-resources/"
|
||||
)
|
||||
|
||||
print("")
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
else:
|
||||
print("Command not recognized!")
|
||||
|
||||
print("")
|
||||
|
||||
except SystemExit:
|
||||
print("")
|
||||
return False
|
||||
|
||||
@@ -127,7 +127,7 @@ def main():
|
||||
b_quit = sm.sen_menu(s_ticker, s_start)
|
||||
|
||||
elif ns_known_args.opt == "res":
|
||||
b_quit = rm.res_menu(s_ticker)
|
||||
b_quit = rm.res_menu(s_ticker, s_start, s_interval)
|
||||
|
||||
elif ns_known_args.opt == "fa":
|
||||
b_quit = fam.fa_menu(s_ticker, s_start, s_interval)
|
||||
@@ -163,7 +163,9 @@ def main():
|
||||
if s_interval == "1440min":
|
||||
b_quit = pm.pred_menu(df_stock, s_ticker, s_start, s_interval)
|
||||
# If stock data is intradaily, we need to get data again as prediction
|
||||
# techniques work on daily adjusted data
|
||||
# techniques work on daily adjusted data. By default we load data from
|
||||
# Alpha Vantage because the historical data loaded gives a larger
|
||||
# dataset than the one provided by quandl
|
||||
else:
|
||||
try:
|
||||
ts = TimeSeries(
|
||||
|
||||
Reference in New Issue
Block a user