From 9fbc3f6162b95d1944dbb0ddc42dcd9ff1f93d6e Mon Sep 17 00:00:00 2001 From: Charlie Date: Mon, 30 Sep 2024 13:17:10 -0700 Subject: [PATCH] More descriptive information --- indicators.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/indicators.py b/indicators.py index 1af1508..ce0dac3 100644 --- a/indicators.py +++ b/indicators.py @@ -666,7 +666,8 @@ if __name__ == "__main__": app = Dash() watchlist = get_watchlist() - symbols = watchlist.index.values.tolist() + # symbols = watchlist.index.values.tolist() + symbols = (watchlist.index.values + " - " + watchlist["Sub Segment"]).tolist() CACHE_CONFIG = {'CACHE_TYPE': 'SimpleCache'} cache = Cache() @@ -680,12 +681,12 @@ if __name__ == "__main__": app.layout = [ html.Div([ html.Button('Reload Syms', id="reload-button", n_clicks=0, - style={'font-size': '12px', 'width': '140px', 'display': 'inline-block', 'margin-bottom': '10px', 'margin-right': '5px', 'height':'36px', 'verticalAlign': 'top'}), + style={'font-size': '12px', 'width': '120px', 'display': 'inline-block', 'margin-bottom': '10px', 'margin-right': '5px', 'height':'36px', 'verticalAlign': 'top'}), html.Div([ dcc.Dropdown(symbols, symbols[0], id='symbols_dropdown_list',), - ], style={'width': '140px', 'text-align': 'center'}), + ], style={'width': '330px', 'text-align': 'center'}), html.Button('Auto Play', id="start-button", n_clicks=0, - style={'font-size': '12px', 'width': '140px', 'display': 'inline-block', 'margin-bottom': '10px', 'margin-right': '5px', 'height':'36px', 'verticalAlign': 'top'}), + style={'font-size': '12px', 'width': '120px', 'display': 'inline-block', 'margin-bottom': '10px', 'margin-right': '5px', 'height':'36px', 'verticalAlign': 'top'}), ], style={'display':'flex', 'justify-content':'center'}), dcc.Graph( @@ -742,7 +743,7 @@ if __name__ == "__main__": def reload_syms(n): if n: watchlist = get_watchlist() - symbols = watchlist.index.values.tolist() + symbols = (watchlist.index.values + " - " + watchlist["Sub Segment"]).tolist() return symbols return no_update @@ -774,8 +775,9 @@ if __name__ == "__main__": # get data # tmp = si.get_data(sym, start_date=sd)[["adjclose", "volume"]] - tmp = fetch_stk_data(col_chosen, start_date) - data, vol, macd, rsi, plot_ind = intelligent_loop_plots(col_chosen, tmp) + sym = col_chosen.split()[0] + tmp = fetch_stk_data(sym, start_date) + data, vol, macd, rsi, plot_ind = intelligent_loop_plots(sym, tmp) fig = make_subplots( rows=3, @@ -844,7 +846,7 @@ if __name__ == "__main__": fig.layout.yaxis4.title="RSI/VoRSI" fig.layout.yaxis.griddash="dash" - fig.update_layout(title_text=plot_ind, title_x=0.5, + fig.update_layout(title_text=sym+' - '+plot_ind, title_x=0.5, margin=dict(l=30, r=20, t=50, b=20), ) # fig.update_layout(showlegend=False)