mistermprah commited on
Commit
f6a2537
·
verified ·
1 Parent(s): 4ebb53d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -130,6 +130,14 @@ if st.sidebar.button("Add Stock Ticker"):
130
  if new_ticker and new_full_name:
131
  stock_dict[new_ticker.upper()] = new_full_name
132
 
 
 
 
 
 
 
 
 
133
  # Tabs for different functionalities
134
  tab1, tab2, tab3 = st.tabs(["Today's Price", "Next Month's Price", "Historical Data"])
135
 
 
130
  if new_ticker and new_full_name:
131
  stock_dict[new_ticker.upper()] = new_full_name
132
 
133
+ # Sidebar for viewing historical trends
134
+ st.sidebar.header("View Historical Trends")
135
+ historical_ticker_input = st.sidebar.selectbox("Stock Ticker", [f"{key} - {value}" for key, value in stock_dict.items()], key="sidebar_historical_ticker")
136
+ if st.sidebar.button("View Historical Data"):
137
+ ticker = historical_ticker_input.split(' - ')[0]
138
+ data = display_historical_data(ticker)
139
+ st.sidebar.line_chart(data['Close'])
140
+
141
  # Tabs for different functionalities
142
  tab1, tab2, tab3 = st.tabs(["Today's Price", "Next Month's Price", "Historical Data"])
143