More descriptive information

This commit is contained in:
George 2024-09-30 13:17:10 -07:00
parent 1ba9698fa9
commit 9fbc3f6162

View File

@ -666,7 +666,8 @@ if __name__ == "__main__":
app = Dash() app = Dash()
watchlist = get_watchlist() 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_CONFIG = {'CACHE_TYPE': 'SimpleCache'}
cache = Cache() cache = Cache()
@ -680,12 +681,12 @@ if __name__ == "__main__":
app.layout = [ app.layout = [
html.Div([ html.Div([
html.Button('Reload Syms', id="reload-button", n_clicks=0, 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([ html.Div([
dcc.Dropdown(symbols, symbols[0], id='symbols_dropdown_list',), 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, 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'}), ], style={'display':'flex', 'justify-content':'center'}),
dcc.Graph( dcc.Graph(
@ -742,7 +743,7 @@ if __name__ == "__main__":
def reload_syms(n): def reload_syms(n):
if n: if n:
watchlist = get_watchlist() watchlist = get_watchlist()
symbols = watchlist.index.values.tolist() symbols = (watchlist.index.values + " - " + watchlist["Sub Segment"]).tolist()
return symbols return symbols
return no_update return no_update
@ -774,8 +775,9 @@ if __name__ == "__main__":
# get data # get data
# tmp = si.get_data(sym, start_date=sd)[["adjclose", "volume"]] # tmp = si.get_data(sym, start_date=sd)[["adjclose", "volume"]]
tmp = fetch_stk_data(col_chosen, start_date) sym = col_chosen.split()[0]
data, vol, macd, rsi, plot_ind = intelligent_loop_plots(col_chosen, tmp) tmp = fetch_stk_data(sym, start_date)
data, vol, macd, rsi, plot_ind = intelligent_loop_plots(sym, tmp)
fig = make_subplots( fig = make_subplots(
rows=3, rows=3,
@ -844,7 +846,7 @@ if __name__ == "__main__":
fig.layout.yaxis4.title="RSI/VoRSI" fig.layout.yaxis4.title="RSI/VoRSI"
fig.layout.yaxis.griddash="dash" 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), margin=dict(l=30, r=20, t=50, b=20),
) )
# fig.update_layout(showlegend=False) # fig.update_layout(showlegend=False)