QuantumLearner commited on
Commit
c7c6f0c
·
verified ·
1 Parent(s): fd00c9d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -285,7 +285,7 @@ st.set_page_config(page_title="Technical Analysis", layout="wide")
285
  st.title('Technical Analysis Indicators')
286
 
287
  # Sidebar for method selection
288
- selected = st.sidebar.radio("Select Indicator", ["Rolling Z-Score", "Rate of Change (ROC)", "Stochastic Oscillator", "Relative Strenght (RSI)", "MACD", "Bollinger Bands", "K Reversal", "Awesome Oscillator", "Williams %R", "Aroon Oscillator"])
289
 
290
  # Sidebar for input parameters
291
  st.sidebar.header("Input Parameters")
@@ -301,18 +301,18 @@ data = st.session_state.data
301
  close_prices = data['Close']
302
 
303
  # Display results based on the selected method
304
- if selected == "Z-Score":
305
  st.markdown("""
306
- ### Z-Score
307
 
308
- This method calculates the z-score of stock prices over different periods. Z-scores help identify overbought and oversold conditions. A z-score above a threshold indicates an overbought condition, while a z-score below a threshold indicates an oversold condition.
309
 
310
  **How to use:**
311
  1. Enter the stock ticker, start date, and end date.
312
  2. Set the number of days for the z-score calculation.
313
  3. Set the z-score threshold.
314
  4. Click 'Fetch Data' to load the stock data.
315
- 5. The chart will display the z-scores and highlight buy/sell signals based on the thresholds.
316
 
317
  **Results:**
318
  The chart shows the close prices with highlighted buy/sell signals and their correctness percentage over a specified period.
@@ -362,7 +362,7 @@ elif selected == "Stochastic Oscillator":
362
  fig = plot_stochastic_oscillator(data, buy_thresh, sell_thresh)
363
  st.plotly_chart(fig)
364
 
365
- elif selected == "RSI":
366
  st.markdown("""
367
  ### Relative Strength Index (RSI)
368
 
 
285
  st.title('Technical Analysis Indicators')
286
 
287
  # Sidebar for method selection
288
+ selected = st.sidebar.radio("Select Indicator", ["Rolling Z-Score", "Rate of Change (ROC)", "Stochastic Oscillator", "Relative Strength Index (RSI)", "MACD", "Bollinger Bands", "K Reversal", "Awesome Oscillator", "Williams %R", "Aroon Oscillator"])
289
 
290
  # Sidebar for input parameters
291
  st.sidebar.header("Input Parameters")
 
301
  close_prices = data['Close']
302
 
303
  # Display results based on the selected method
304
+ if selected == "Rolling Z-Score":
305
  st.markdown("""
306
+ ### Rolling Z-Score
307
 
308
+ This method calculates the rolling z-score of stock prices over different periods. Rolling z-scores help identify overbought and oversold conditions. A z-score above a threshold indicates an overbought condition, while a z-score below a threshold indicates an oversold condition.
309
 
310
  **How to use:**
311
  1. Enter the stock ticker, start date, and end date.
312
  2. Set the number of days for the z-score calculation.
313
  3. Set the z-score threshold.
314
  4. Click 'Fetch Data' to load the stock data.
315
+ 5. The chart will display the rolling z-scores and highlight buy/sell signals based on the thresholds.
316
 
317
  **Results:**
318
  The chart shows the close prices with highlighted buy/sell signals and their correctness percentage over a specified period.
 
362
  fig = plot_stochastic_oscillator(data, buy_thresh, sell_thresh)
363
  st.plotly_chart(fig)
364
 
365
+ elif selected == "Relative Strength Index (RSI)":
366
  st.markdown("""
367
  ### Relative Strength Index (RSI)
368