mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-24 18:22:43 +00:00
Add info regarding Fundamental Analysis key metrics
This commit is contained in:
@@ -10,9 +10,15 @@
|
||||
using an API request.
|
||||
|
||||
Finviz for data
|
||||
Parse overview stock with pip request
|
||||
Multiple TA with kind stock
|
||||
|
||||
Do my own personal Fundamental Analysis Dataframe
|
||||
Do option to explain important key metrics
|
||||
|
||||
Do own personal Technical Analysis with multiple indicators perhaps?
|
||||
|
||||
Split Menu into fa, ta and pred. Fundamental Analysis, Technical Analysis and Prediction, respectively.
|
||||
|
||||
"""
|
||||
|
||||
from alpha_vantage.timeseries import TimeSeries
|
||||
@@ -54,6 +60,7 @@ def print_help(s_ticker, s_start, s_interval, b_is_market_open):
|
||||
|
||||
if s_ticker:
|
||||
print("\nFundamental Analysis:") # https://github.com/JerBouma/FundamentalAnalysis
|
||||
print(" info provides information on main key metrics of company")
|
||||
print("details:")
|
||||
print(" profile profile of the company [FMP]")
|
||||
print(" rating rating of the company from strong sell to strong buy [FMP]")
|
||||
@@ -118,7 +125,7 @@ def main():
|
||||
s_interval = "1440min"
|
||||
|
||||
# Set stock by default to speed up testing
|
||||
s_ticker = "TSLA"
|
||||
s_ticker = "NIO"
|
||||
s_start = datetime.strptime("2020-06-04", "%Y-%m-%d")
|
||||
ts = TimeSeries(key=cfg.API_KEY_ALPHAVANTAGE, output_format='pandas')
|
||||
df_stock, d_stock_metadata = ts.get_daily_adjusted(symbol=s_ticker, outputsize='full')
|
||||
@@ -132,7 +139,7 @@ def main():
|
||||
'sma', 'ema', 'macd', 'vwap', 'stoch', 'rsi', 'adx', 'quote',
|
||||
'cci', 'aroon', 'bbands', 'ad', 'obv', 'rating', 'profile',
|
||||
'income', 'balance', 'cash', 'metrics', 'ratios', 'growth',
|
||||
'enterprise', 'dcf', 'overview', 'earnings'])
|
||||
'enterprise', 'dcf', 'overview', 'earnings', 'info'])
|
||||
|
||||
# Print first welcome message and help
|
||||
print("\nWelcome to Didier's Stock Market Bot\n")
|
||||
@@ -195,6 +202,10 @@ def main():
|
||||
# --------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# -------------------------------------------------- DETAILS --------------------------------------------------
|
||||
elif ns_known_args.cmd == 'info':
|
||||
smfa.info(l_args, s_ticker)
|
||||
continue
|
||||
|
||||
elif ns_known_args.cmd == 'profile':
|
||||
smfa.profile(l_args, s_ticker)
|
||||
continue
|
||||
|
||||
@@ -11,6 +11,33 @@ import requests
|
||||
from pandas.io.json import json_normalize
|
||||
|
||||
|
||||
# ---------------------------------------------------- INFO ----------------------------------------------------
|
||||
def info(l_args, s_ticker):
|
||||
parser = argparse.ArgumentParser(prog='info',
|
||||
description="""Provides information about main key metrics. Namely: EBITDA,
|
||||
EPS, P/E, PEG, FCF, P/B, ROE, DPR, P/S, Dividend Yield Ratio, D/E, and Beta.""")
|
||||
|
||||
try:
|
||||
(ns_parser, l_unknown_args) = parser.parse_known_args(l_args)
|
||||
except SystemExit:
|
||||
print("")
|
||||
return
|
||||
|
||||
if l_unknown_args:
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}")
|
||||
|
||||
try:
|
||||
filepath = 'fundamental_analysis_indicators_explained.txt'
|
||||
with open(filepath) as fp:
|
||||
line = fp.readline()
|
||||
while line:
|
||||
print("{}".format(line.strip()))
|
||||
line = fp.readline()
|
||||
print("")
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
|
||||
|
||||
# ---------------------------------------------------- PROFILE ----------------------------------------------------
|
||||
def profile(l_args, s_ticker):
|
||||
parser = argparse.ArgumentParser(prog='profile',
|
||||
|
||||
Reference in New Issue
Block a user