QuantumLearner commited on
Commit
6d39293
·
verified ·
1 Parent(s): 64fbb46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -25
app.py CHANGED
@@ -587,31 +587,31 @@ if st.sidebar.button("Run Analysis"):
587
  """)
588
  st.plotly_chart(plot_surprise_vs_price_effect(earnings_dates), use_container_width=True)
589
 
590
- st.subheader("Monte Carlo Simulation for Normalized Price Movements")
591
- st.markdown("This plot shows the results of a Monte Carlo simulation for normalized price movements around earnings dates. "
592
- "We simulate multiple price paths to estimate the probabilities of price movements exceeding given thresholds.")
593
- window_days = list(range(-pre_announcement_window, post_announcement_window + 1))
594
- st.plotly_chart(monte_carlo_normalized_prices(all_normalized_prices, upper_threshold, lower_threshold, latest_close_price, window_days, ticker), use_container_width=True)
595
-
596
- up_target = latest_close_price * upper_threshold
597
- down_target = latest_close_price * lower_threshold
598
-
599
- st.subheader("Expected Price Range Based on Implied Volatility")
600
- st.markdown("This plot shows the expected price range of the stock based on implied volatility over a specified period. "
601
- "It uses the current stock price and implied volatility to estimate the upper and lower bounds.")
602
- st.latex(r"""
603
- \text{Upper Bound} = S_0 \times (1 + \sigma \sqrt{t})
604
- """)
605
- st.latex(r"""
606
- \text{Lower Bound} = S_0 \times (1 - \sigma \sqrt{t})
607
- """)
608
- st.plotly_chart(plot_price_ranges(ticker, implied_volatility, days_until_earnings, up_target, down_target, stock_data), use_container_width=True)
609
-
610
- st.subheader("Monte Carlo Simulation for Price Movements")
611
- st.markdown("We simulate multiple price paths using the stock's implied volatility to estimate the probabilities of the stock price reaching given targets.")
612
- st.markdown("Implied volatility (IV) is used to model the expected volatility of the stock's price. "
613
- "The simulation generates random price paths based on the IV, the current stock price, and the time remaining until the earnings date.")
614
- st.plotly_chart(monte_carlo_simulation(ticker, implied_volatility, days_until_earnings, up_target, down_target, stock_data, num_simulations), use_container_width=True)
615
 
616
  except Exception as e:
617
  st.error("An error occurred while running the analysis. Please try again.")
 
587
  """)
588
  st.plotly_chart(plot_surprise_vs_price_effect(earnings_dates), use_container_width=True)
589
 
590
+ #st.subheader("Monte Carlo Simulation for Normalized Price Movements")
591
+ #st.markdown("This plot shows the results of a Monte Carlo simulation for normalized price movements around earnings dates. "
592
+ # "We simulate multiple price paths to estimate the probabilities of price movements exceeding given thresholds.")
593
+ #window_days = list(range(-pre_announcement_window, post_announcement_window + 1))
594
+ #st.plotly_chart(monte_carlo_normalized_prices(all_normalized_prices, upper_threshold, lower_threshold, latest_close_price, window_days, ticker), use_container_width=True)
595
+
596
+ #up_target = latest_close_price * upper_threshold
597
+ #down_target = latest_close_price * lower_threshold
598
+
599
+ #st.subheader("Expected Price Range Based on Implied Volatility")
600
+ #st.markdown("This plot shows the expected price range of the stock based on implied volatility over a specified period. "
601
+ # "It uses the current stock price and implied volatility to estimate the upper and lower bounds.")
602
+ #st.latex(r"""
603
+ # \text{Upper Bound} = S_0 \times (1 + \sigma \sqrt{t})
604
+ #""")
605
+ #st.latex(r"""
606
+ # \text{Lower Bound} = S_0 \times (1 - \sigma \sqrt{t})
607
+ #""")
608
+ #st.plotly_chart(plot_price_ranges(ticker, implied_volatility, days_until_earnings, up_target, down_target, stock_data), use_container_width=True)
609
+
610
+ #st.subheader("Monte Carlo Simulation for Price Movements")
611
+ #st.markdown("We simulate multiple price paths using the stock's implied volatility to estimate the probabilities of the stock price reaching given targets.")
612
+ #st.markdown("Implied volatility (IV) is used to model the expected volatility of the stock's price. "
613
+ # "The simulation generates random price paths based on the IV, the current stock price, and the time remaining until the earnings date.")
614
+ #st.plotly_chart(monte_carlo_simulation(ticker, implied_volatility, days_until_earnings, up_target, down_target, stock_data, num_simulations), use_container_width=True)
615
 
616
  except Exception as e:
617
  st.error("An error occurred while running the analysis. Please try again.")