Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,6 @@ st.set_page_config(layout="wide")
|
|
| 12 |
|
| 13 |
st.title("Options Sentiment Analysis Tool")
|
| 14 |
st.markdown("""
|
| 15 |
-
## Options Sentiment Analysis Tool
|
| 16 |
This tool analyzes options data for a given stock ticker symbol to gauge market sentiment. By examining the implied volatility of call and put options, you can infer the market's expectations of future price movements and overall sentiment.
|
| 17 |
**Implied Volatility (IV)** is a critical concept in options trading. It represents the market's forecast of a likely movement in a security's price. High implied volatility often signals uncertainty or expected volatility, while comparing call and put options can provide insights into bullish or bearish sentiments.
|
| 18 |
### How It Works:
|
|
@@ -32,12 +31,16 @@ In practice, implied volatility (IV) is derived using the Black-Scholes formula,
|
|
| 32 |
|
| 33 |
### Visualizations:
|
| 34 |
- **Volatility Smile**: Displays the implied volatility of call and put options across different strike prices and expiration dates, providing insights into expected price volatility.
|
| 35 |
-
- **
|
| 36 |
-
- **
|
| 37 |
-
- **
|
| 38 |
-
- **
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
def get_options_data(ticker):
|
| 43 |
asset = yf.Ticker(ticker)
|
|
|
|
| 12 |
|
| 13 |
st.title("Options Sentiment Analysis Tool")
|
| 14 |
st.markdown("""
|
|
|
|
| 15 |
This tool analyzes options data for a given stock ticker symbol to gauge market sentiment. By examining the implied volatility of call and put options, you can infer the market's expectations of future price movements and overall sentiment.
|
| 16 |
**Implied Volatility (IV)** is a critical concept in options trading. It represents the market's forecast of a likely movement in a security's price. High implied volatility often signals uncertainty or expected volatility, while comparing call and put options can provide insights into bullish or bearish sentiments.
|
| 17 |
### How It Works:
|
|
|
|
| 31 |
|
| 32 |
### Visualizations:
|
| 33 |
- **Volatility Smile**: Displays the implied volatility of call and put options across different strike prices and expiration dates, providing insights into expected price volatility.
|
| 34 |
+
- **Open Interest**: Shows the open interest of call and put options across different strike prices, indicating the level of trading activity and interest.
|
| 35 |
+
- **Volume Analysis**: Presents the trading volume of call and put options across different strike prices, reflecting the market's trading activity and interest.
|
| 36 |
+
- **3D Scatter Plot**:
|
| 37 |
+
- **Puts**: Visualizes the implied volatility of put options in a 3D view, categorized by expiration date, to identify patterns and sentiment shifts.
|
| 38 |
+
- **Calls**: Visualizes the implied volatility of call options in a 3D view, categorized by expiration date, to identify patterns and sentiment shifts.
|
| 39 |
+
- **Historical Implied Volatility (IV)**: Tracks the historical implied volatility over a specified period, helping to understand the volatility trends and current volatility level compared to the past.
|
| 40 |
+
- **Put/Call Ratio**: Calculates the ratio of the trading volume of put options to call options, indicating overall market sentiment (bullish or bearish).
|
| 41 |
+
- **Options Greeks Analysis**: Assesses the Greeks (Delta, Gamma, Theta, Vega) of call and put options, providing insights into the sensitivity of options prices to various factors.
|
| 42 |
+
- **Sentiment Score**: Combines implied volatility and volume data to generate a sentiment score, indicating whether the market sentiment is bullish or bearish."""
|
| 43 |
+
)
|
| 44 |
|
| 45 |
def get_options_data(ticker):
|
| 46 |
asset = yf.Ticker(ticker)
|