Spaces:
Running
Running
Commit
·
ac64c34
1
Parent(s):
854cf16
Update app.py
Browse files
app.py
CHANGED
@@ -49,6 +49,24 @@ def get_hvplot(ticker , startdate , enddate , interval,window):
|
|
49 |
# return (scatter_plot * line_plot).opts(width=800, height=600, show_grid=True, gridstyle={ 'grid_line_color': 'gray'})
|
50 |
# grid_style = {'grid_line_color': 'black'}#, 'grid_line_width': 1.5, 'ygrid_bounds': (0.3, 0.7),'minor_xgrid_line_color': 'lightgray', 'xgrid_line_dash': [4, 4]}
|
51 |
return (scatter_plot * line_plot *line_plot_SMA).opts(width=800, height=600, show_grid=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
|
54 |
|
@@ -79,7 +97,8 @@ date_end.value = date.today()
|
|
79 |
pn.Row(
|
80 |
pn.Column( ticker, window , date_start , date_end),
|
81 |
# pn.panel(pn.bind(get_hvplot, ticker, "2010-01-01","2023-09-01","1d")) #, sizing_mode='stretch_width')
|
82 |
-
pn.panel(pn.bind(get_hvplot, ticker, date_start , date_end,"1d",window)) #, sizing_mode='stretch_width')
|
|
|
83 |
).servable(title="Under Valued Screener- Linear Regression")
|
84 |
|
85 |
|
|
|
49 |
# return (scatter_plot * line_plot).opts(width=800, height=600, show_grid=True, gridstyle={ 'grid_line_color': 'gray'})
|
50 |
# grid_style = {'grid_line_color': 'black'}#, 'grid_line_width': 1.5, 'ygrid_bounds': (0.3, 0.7),'minor_xgrid_line_color': 'lightgray', 'xgrid_line_dash': [4, 4]}
|
51 |
return (scatter_plot * line_plot *line_plot_SMA).opts(width=800, height=600, show_grid=True)
|
52 |
+
def get_income_statement_df(ticker):
|
53 |
+
yfobj = yf.Ticker(ticker)
|
54 |
+
df= yfobj.financials.T
|
55 |
+
df.index = pd.to_datetime(df.index, format='%Y-%m-%d')
|
56 |
+
return df
|
57 |
+
|
58 |
+
def get_income_hvplot(ticker):
|
59 |
+
DF = get_income_statement_df(ticker)
|
60 |
+
plt1 = DF.hvplot.line(y='Total Revenue') * DF.hvplot.scatter(y='Total Revenue').opts(color="red")
|
61 |
+
plt1.opts(width=600, height=450, show_grid=True)
|
62 |
+
plt2 = DF.hvplot.line(y='Gross Profit') * DF.hvplot.scatter(y='Gross Profit').opts(color="red")
|
63 |
+
plt2.opts(width=600, height=450, show_grid=True)
|
64 |
+
plt3 = DF.hvplot.line(y='Net Income') * DF.hvplot.scatter(y='Net Income').opts(color="red")
|
65 |
+
plt3.opts(width=600, height=450, show_grid=True)
|
66 |
+
return pn.Column(plt1 , plt2 , plt3 )
|
67 |
+
# return ( DF.hvplot.line(y='Net Income') * DF.hvplot.scatter(y='Net Income').opts(color="red") )+ (DF.hvplot.line(y='Gross Profit') * DF.hvplot.scatter(y='Gross Profit').opts(color="red") )+
|
68 |
+
# (DF.hvplot.line(y='Total Revenue') * DF.hvplot.scatter(y='Total Revenue').opts(color="red") )
|
69 |
+
|
70 |
|
71 |
|
72 |
|
|
|
97 |
pn.Row(
|
98 |
pn.Column( ticker, window , date_start , date_end),
|
99 |
# pn.panel(pn.bind(get_hvplot, ticker, "2010-01-01","2023-09-01","1d")) #, sizing_mode='stretch_width')
|
100 |
+
pn.panel(pn.bind(get_hvplot, ticker, date_start , date_end,"1d",window)), #, sizing_mode='stretch_width')
|
101 |
+
pn.panel(pn.bind(get_income_hvplot, ticker)) #, sizing_mode='stretch_width')
|
102 |
).servable(title="Under Valued Screener- Linear Regression")
|
103 |
|
104 |
|