options-strategy-advisor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOptions Strategy Advisor
期权策略顾问
Overview
概述
This skill provides comprehensive options strategy analysis and education using theoretical pricing models. It helps traders understand, analyze, and simulate options strategies without requiring real-time market data subscriptions.
Core Capabilities:
- Black-Scholes Pricing: Theoretical option prices and Greeks calculation
- Strategy Simulation: P/L analysis for major options strategies
- Earnings Strategies: Pre-earnings volatility plays integrated with Earnings Calendar
- Risk Management: Position sizing, Greeks exposure, max loss/profit analysis
- Educational Focus: Detailed explanations of strategies and risk metrics
Data Sources:
- FMP API: Stock prices, historical volatility, dividends, earnings dates
- User Input: Implied volatility (IV), risk-free rate
- Theoretical Models: Black-Scholes for pricing and Greeks
本工具采用理论定价模型,提供全面的期权策略分析与教育服务,帮助交易者在无需实时市场数据订阅的情况下理解、分析并模拟期权策略。
核心功能:
- Black-Scholes Pricing:期权理论价格与Greeks(希腊值)计算
- 策略模拟:主流期权策略的盈亏(P/L)分析
- 财报季策略:结合财报日历的财报前波动率交易策略
- 风险管理:仓位规模计算、Greeks敞口分析、最大盈亏评估
- 教育导向:策略与风险指标的详细讲解
数据来源:
- FMP API:股票价格、历史波动率、股息、财报日期
- 用户输入:隐含波动率(IV)、无风险利率
- 理论模型:用于定价与希腊值计算的Black-Scholes模型
When to Use This Skill
使用场景
Use this skill when:
- User asks about options strategies ("What's a covered call?", "How does an iron condor work?")
- User wants to simulate strategy P/L ("What's my max profit on a bull call spread?")
- User needs Greeks analysis ("What's my delta exposure?")
- User asks about earnings strategies ("Should I buy a straddle before earnings?")
- User wants to compare strategies ("Covered call vs protective put?")
- User needs position sizing guidance ("How many contracts should I trade?")
- User asks about volatility ("Is IV high right now?")
Example requests:
- "Analyze a covered call on AAPL"
- "What's the P/L on a $100/$105 bull call spread on MSFT?"
- "Should I trade a straddle before NVDA earnings?"
- "Calculate Greeks for my iron condor position"
- "Compare protective put vs covered call for downside protection"
当以下情况时可使用本工具:
- 用户询问期权策略相关问题(如“什么是Covered Call?”“Iron Condor如何运作?”)
- 用户希望模拟策略盈亏(如“牛市看涨价差策略的最大盈利是多少?”)
- 用户需要Greeks分析(如“我的Delta敞口是多少?”)
- 用户询问财报季策略(如“财报前应该买入跨式期权吗?”)
- 用户希望对比不同策略(如“Covered Call和Protective Put哪个更适合下行保护?”)
- 用户需要仓位规模指导(如“我应该交易多少张合约?”)
- 用户询问波动率相关问题(如“当前IV处于高位吗?”)
示例请求:
- “分析AAPL的Covered Call策略”
- “MSFT的100/105美元牛市看涨价差策略的盈亏情况如何?”
- “NVDA财报前我应该交易跨式期权吗?”
- “计算我的Iron Condor仓位的Greeks”
- “对比Protective Put与Covered Call的下行保护效果”
Supported Strategies
支持的策略
Income Strategies
收益类策略
- Covered Call - Own stock, sell call (generate income, cap upside)
- Cash-Secured Put - Sell put with cash backing (collect premium, willing to buy stock)
- Poor Man's Covered Call - LEAPS call + short near-term call (capital efficient)
- Covered Call - 持有股票同时卖出看涨期权(赚取权利金,限制上行收益)
- Cash-Secured Put - 卖出看跌期权并备有足额现金(收取权利金,愿意买入股票)
- Poor Man's Covered Call - 长期股票期权(LEAPS)+ 短期看涨期权空头(资本高效型)
Protection Strategies
保护类策略
- Protective Put - Own stock, buy put (insurance, limited downside)
- Collar - Own stock, sell call + buy put (limited upside/downside)
- Protective Put - 持有股票同时买入看跌期权(对冲风险,限制下行损失)
- Collar - 持有股票同时卖出看涨期权+买入看跌期权(限制上下行波动)
Directional Strategies
方向性策略
- Bull Call Spread - Buy lower strike call, sell higher strike call (limited risk/reward bullish)
- Bull Put Spread - Sell higher strike put, buy lower strike put (credit spread, bullish)
- Bear Call Spread - Sell lower strike call, buy higher strike call (credit spread, bearish)
- Bear Put Spread - Buy higher strike put, sell lower strike put (limited risk/reward bearish)
- Bull Call Spread - 买入低执行价看涨期权,卖出高执行价看涨期权(有限风险/收益的看涨策略)
- Bull Put Spread - 卖出高执行价看跌期权,买入低执行价看跌期权(信用价差,看涨策略)
- Bear Call Spread - 卖出低执行价看涨期权,买入高执行价看涨期权(信用价差,看跌策略)
- Bear Put Spread - 买入高执行价看跌期权,卖出低执行价看跌期权(有限风险/收益的看跌策略)
Volatility Strategies
波动率策略
- Long Straddle - Buy ATM call + ATM put (profit from big move either direction)
- Long Strangle - Buy OTM call + OTM put (cheaper than straddle, bigger move needed)
- Short Straddle - Sell ATM call + ATM put (profit from no movement, unlimited risk)
- Short Strangle - Sell OTM call + OTM put (profit from no movement, wider range)
- Long Straddle - 买入平值看涨期权+平值看跌期权(股价大幅波动时盈利,方向不限)
- Long Strangle - 买入虚值看涨期权+虚值看跌期权(比跨式期权成本低,需要更大波动)
- Short Straddle - 卖出平值看涨期权+平值看跌期权(股价无波动时盈利,风险无限)
- Short Strangle - 卖出虚值看涨期权+虚值看跌期权(股价无波动时盈利,波动范围更大)
Range-Bound Strategies
区间震荡策略
- Iron Condor - Bull put spread + bear call spread (profit from range-bound movement)
- Iron Butterfly - Sell ATM straddle, buy OTM strangle (profit from tight range)
- Iron Condor - 牛市看跌价差+熊市看涨价差(股价区间震荡时盈利)
- Iron Butterfly - 卖出平值跨式期权,买入虚值宽跨式期权(股价窄幅震荡时盈利)
Advanced Strategies
进阶策略
- Calendar Spread - Sell near-term option, buy longer-term option (profit from time decay)
- Diagonal Spread - Calendar spread with different strikes (directional + time decay)
- Ratio Spread - Unbalanced spread (more contracts on one leg)
- Calendar Spread - 卖出短期期权,买入长期期权(赚取时间衰减收益)
- Diagonal Spread - 不同执行价的日历价差(兼具方向性与时间衰减收益)
- Ratio Spread - 非对称价差(某一侧合约数量更多)
Analysis Workflow
分析流程
Step 1: Gather Input Data
步骤1:收集输入数据
Required from User:
- Ticker symbol
- Strategy type
- Strike prices
- Expiration date(s)
- Position size (number of contracts)
Optional from User:
- Implied Volatility (IV) - if not provided, use Historical Volatility (HV)
- Risk-free rate - default to current 3-month T-bill rate (~5.3% as of 2025)
Fetched from FMP API:
- Current stock price
- Historical prices (for HV calculation)
- Dividend yield
- Upcoming earnings date (for earnings strategies)
Example User Input:
Ticker: AAPL
Strategy: Bull Call Spread
Long Strike: $180
Short Strike: $185
Expiration: 30 days
Contracts: 10
IV: 25% (or use HV if not provided)用户需提供:
- 股票代码
- 策略类型
- 执行价格
- 到期日期
- 仓位规模(合约数量)
用户可选提供:
- 隐含波动率(IV)- 若未提供,使用历史波动率(HV)
- 无风险利率 - 默认使用当前3个月国债收益率(2025年约为5.3%)
从FMP API获取:
- 当前股价
- 历史价格(用于计算HV)
- 股息率
- 即将到来的财报日期(用于财报季策略)
示例用户输入:
股票代码:AAPL
策略:Bull Call Spread
多头执行价:180美元
空头执行价:185美元
到期时间:30天
合约数量:10
IV:25%(若未提供则使用HV)Step 2: Calculate Historical Volatility (if IV not provided)
步骤2:计算历史波动率(若未提供IV)
Objective: Estimate volatility from historical price movements.
Method:
python
undefined目标: 从历史价格波动中估算波动率
方法:
python
undefinedFetch 90 days of price data
获取90天的价格数据
prices = get_historical_prices("AAPL", days=90)
prices = get_historical_prices("AAPL", days=90)
Calculate daily returns
计算日收益率
returns = np.log(prices / prices.shift(1))
returns = np.log(prices / prices.shift(1))
Annualized volatility
年化波动率
HV = returns.std() * np.sqrt(252) # 252 trading days
**Output:**
- Historical Volatility (annualized percentage)
- Note to user: "HV = 24.5%, consider using current market IV for more accuracy"
**User Can Override:**
- Provide IV from broker platform (ThinkorSwim, TastyTrade, etc.)
- Script accepts `--iv 28.0` parameterHV = returns.std() * np.sqrt(252) # 252个交易日
**输出:**
- 年化历史波动率(百分比)
- 提示用户:“HV = 24.5%,建议使用当前市场IV以获得更准确的结果”
**用户可覆盖:**
- 从经纪商平台(如ThinkorSwim、TastyTrade等)提供IV
- 脚本支持`--iv 28.0`参数Step 3: Price Options Using Black-Scholes
步骤3:使用Black-Scholes模型为期权定价
Black-Scholes Model:
For European-style options:
Call Price = S * N(d1) - K * e^(-r*T) * N(d2)
Put Price = K * e^(-r*T) * N(-d2) - S * N(-d1)
Where:
d1 = [ln(S/K) + (r + σ²/2) * T] / (σ * √T)
d2 = d1 - σ * √T
S = Current stock price
K = Strike price
r = Risk-free rate
T = Time to expiration (years)
σ = Volatility (IV or HV)
N() = Cumulative standard normal distributionAdjustments:
- Subtract present value of dividends from S for calls
- American options: Use approximation or note "European pricing, may undervalue American options"
Python Implementation:
python
from scipy.stats import norm
import numpy as np
def black_scholes_call(S, K, T, r, sigma, q=0):
"""
S: Stock price
K: Strike price
T: Time to expiration (years)
r: Risk-free rate
sigma: Volatility
q: Dividend yield
"""
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
d2 = d1 - sigma*np.sqrt(T)
call_price = S*np.exp(-q*T)*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)
return call_price
def black_scholes_put(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
d2 = d1 - sigma*np.sqrt(T)
put_price = K*np.exp(-r*T)*norm.cdf(-d2) - S*np.exp(-q*T)*norm.cdf(-d1)
return put_priceOutput for Each Option Leg:
- Theoretical price
- Note: "Market price may differ due to bid-ask spread and American vs European pricing"
Black-Scholes模型:
对于欧式期权:
看涨期权价格 = S * N(d1) - K * e^(-r*T) * N(d2)
看跌期权价格 = K * e^(-r*T) * N(-d2) - S * N(-d1)
其中:
d1 = [ln(S/K) + (r + σ²/2) * T] / (σ * √T)
d2 = d1 - σ * √T
S = 当前股价
K = 执行价格
r = 无风险利率
T = 到期时间(年)
σ = 波动率(IV或HV)
N() = 累积标准正态分布调整项:
- 看涨期权需从S中扣除股息的现值
- 美式期权:使用近似值或提示“采用欧式定价,可能低估美式期权价值”
Python实现:
python
from scipy.stats import norm
import numpy as np
def black_scholes_call(S, K, T, r, sigma, q=0):
"""
S: 股价
K: 执行价格
T: 到期时间(年)
r: 无风险利率
sigma: 波动率
q: 股息率
"""
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
d2 = d1 - sigma*np.sqrt(T)
call_price = S*np.exp(-q*T)*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)
return call_price
def black_scholes_put(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
d2 = d1 - sigma*np.sqrt(T)
put_price = K*np.exp(-r*T)*norm.cdf(-d2) - S*np.exp(-q*T)*norm.cdf(-d1)
return put_price每个期权腿的输出:
- 理论价格
- 提示:“市场价格可能因买卖价差、美式与欧式定价差异而有所不同”
Step 4: Calculate Greeks
步骤4:计算Greeks(希腊值)
The Greeks measure option price sensitivity to various factors:
Delta (Δ): Change in option price per $1 change in stock price
python
def delta_call(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
return np.exp(-q*T) * norm.cdf(d1)
def delta_put(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
return np.exp(-q*T) * (norm.cdf(d1) - 1)Gamma (Γ): Change in delta per $1 change in stock price
python
def gamma(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
return np.exp(-q*T) * norm.pdf(d1) / (S * sigma * np.sqrt(T))Theta (Θ): Change in option price per day (time decay)
python
def theta_call(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
d2 = d1 - sigma*np.sqrt(T)
theta = (-S*norm.pdf(d1)*sigma*np.exp(-q*T)/(2*np.sqrt(T))
- r*K*np.exp(-r*T)*norm.cdf(d2)
+ q*S*norm.cdf(d1)*np.exp(-q*T))
return theta / 365 # Per dayVega (ν): Change in option price per 1% change in volatility
python
def vega(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
return S * np.exp(-q*T) * norm.pdf(d1) * np.sqrt(T) / 100 # Per 1%Rho (ρ): Change in option price per 1% change in interest rate
python
def rho_call(S, K, T, r, sigma, q=0):
d2 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T)) - sigma*np.sqrt(T)
return K * T * np.exp(-r*T) * norm.cdf(d2) / 100 # Per 1%Position Greeks:
For a strategy with multiple legs, sum Greeks across all legs:
python
undefinedGreeks用于衡量期权价格对各类因素的敏感度:
Delta (Δ): 股价每变动1美元时期权价格的变动幅度
python
def delta_call(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
return np.exp(-q*T) * norm.cdf(d1)
def delta_put(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
return np.exp(-q*T) * (norm.cdf(d1) - 1)Gamma (Γ): 股价每变动1美元时Delta的变动幅度
python
def gamma(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
return np.exp(-q*T) * norm.pdf(d1) / (S * sigma * np.sqrt(T))Theta (Θ): 每日时间流逝时期权价格的变动幅度(时间衰减)
python
def theta_call(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
d2 = d1 - sigma*np.sqrt(T)
theta = (-S*norm.pdf(d1)*sigma*np.exp(-q*T)/(2*np.sqrt(T))
- r*K*np.exp(-r*T)*norm.cdf(d2)
+ q*S*norm.cdf(d1)*np.exp(-q*T))
return theta / 365 # 每日Vega (ν): 波动率每变动1%时期权价格的变动幅度
python
def vega(S, K, T, r, sigma, q=0):
d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))
return S * np.exp(-q*T) * norm.pdf(d1) * np.sqrt(T) / 100 # 每变动1%Rho (ρ): 利率每变动1%时期权价格的变动幅度
python
def rho_call(S, K, T, r, sigma, q=0):
d2 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T)) - sigma*np.sqrt(T)
return K * T * np.exp(-r*T) * norm.cdf(d2) / 100 # 每变动1%仓位Greeks:
对于多腿策略,将所有腿的Greeks求和:
python
undefinedExample: Bull Call Spread
示例:Bull Call Spread
Long 1x $180 call
多头1张180美元看涨期权
Short 1x $185 call
空头1张185美元看涨期权
delta_position = (1 * delta_long) + (-1 * delta_short)
gamma_position = (1 * gamma_long) + (-1 * gamma_short)
theta_position = (1 * theta_long) + (-1 * theta_short)
vega_position = (1 * vega_long) + (-1 * vega_short)
**Greeks Interpretation:**
| Greek | Meaning | Example |
|-------|---------|---------|
| **Delta** | Directional exposure | Δ = 0.50 → $50 profit if stock +$1 |
| **Gamma** | Delta acceleration | Γ = 0.05 → Delta increases by 0.05 if stock +$1 |
| **Theta** | Daily time decay | Θ = -$5 → Lose $5/day from time passing |
| **Vega** | Volatility sensitivity | ν = $10 → Gain $10 if IV increases 1% |
| **Rho** | Interest rate sensitivity | ρ = $2 → Gain $2 if rates increase 1% |delta_position = (1 * delta_long) + (-1 * delta_short)
gamma_position = (1 * gamma_long) + (-1 * gamma_short)
theta_position = (1 * theta_long) + (-1 * theta_short)
vega_position = (1 * vega_long) + (-1 * vega_short)
**Greeks解读:**
| 希腊值 | 含义 | 示例 |
|-------|---------|---------|
| **Delta** | 方向性敞口 | Δ = 0.50 → 股价上涨1美元时盈利50美元 |
| **Gamma** | Delta的变动率 | Γ = 0.05 → 股价上涨1美元时Delta增加0.05 |
| **Theta** | 每日时间衰减 | Θ = -5美元 → 每日因时间流逝损失5美元 |
| **Vega** | 波动率敏感度 | ν = 10美元 → IV上涨1%时盈利10美元 |
| **Rho** | 利率敏感度 | ρ = 2美元 → 利率上涨1%时盈利2美元 |Step 5: Simulate Strategy P/L
步骤5:模拟策略盈亏
Objective: Calculate profit/loss at various stock prices at expiration.
Method:
Generate stock price range (e.g., ±30% from current price):
python
current_price = 180
price_range = np.linspace(current_price * 0.7, current_price * 1.3, 100)For each price point, calculate P/L:
python
def calculate_pnl(strategy, stock_price_at_expiration):
pnl = 0
for leg in strategy.legs:
if leg.type == 'call':
intrinsic_value = max(0, stock_price_at_expiration - leg.strike)
else: # put
intrinsic_value = max(0, leg.strike - stock_price_at_expiration)
if leg.position == 'long':
pnl += (intrinsic_value - leg.premium_paid) * 100 # Per contract
else: # short
pnl += (leg.premium_received - intrinsic_value) * 100
return pnl * num_contractsKey Metrics:
- Max Profit: Highest possible P/L
- Max Loss: Worst possible P/L
- Breakeven Point(s): Stock price(s) where P/L = 0
- Profit Probability: Percentage of price range that's profitable (simplified)
Example Output:
Bull Call Spread: $180/$185 on AAPL (30 DTE, 10 contracts)
Current Price: $180.00
Net Debit: $2.50 per spread ($2,500 total)
Max Profit: $2,500 (at $185+)
Max Loss: -$2,500 (at $180-)
Breakeven: $182.50
Risk/Reward: 1:1
Probability Profit: ~55% (if stock stays above $182.50)目标: 计算到期时不同股价下的盈亏情况
方法:
生成股价范围(如当前股价±30%):
python
current_price = 180
price_range = np.linspace(current_price * 0.7, current_price * 1.3, 100)针对每个价格点计算盈亏:
python
def calculate_pnl(strategy, stock_price_at_expiration):
pnl = 0
for leg in strategy.legs:
if leg.type == 'call':
intrinsic_value = max(0, stock_price_at_expiration - leg.strike)
else: # put
intrinsic_value = max(0, leg.strike - stock_price_at_expiration)
if leg.position == 'long':
pnl += (intrinsic_value - leg.premium_paid) * 100 # 每张合约
else: # short
pnl += (leg.premium_received - intrinsic_value) * 100
return pnl * num_contracts关键指标:
- 最大盈利:可能的最高盈亏
- 最大损失:最坏情况下的盈亏
- 盈亏平衡点:盈亏为0时的股价
- 盈利概率:股价范围中盈利区间的占比(简化计算)
示例输出:
Bull Call Spread:AAPL的180/185美元价差(30天到期,10张合约)
当前股价:180.00美元
净权利金支出:每笔价差2.50美元(总计2500美元)
最大盈利:2500美元(股价≥185美元时)
最大损失:-2500美元(股价≤180美元时)
盈亏平衡点:182.50美元
风险收益比:1:1
盈利概率:约55%(股价高于182.50美元时)Step 6: Generate P/L Diagram (ASCII Art)
步骤6:生成盈亏示意图(ASCII艺术)
Visual representation of P/L across stock prices:
python
def generate_pnl_diagram(price_range, pnl_values, current_price, width=60, height=15):
"""Generate ASCII P/L diagram"""
# Normalize to chart dimensions
max_pnl = max(pnl_values)
min_pnl = min(pnl_values)
lines = []
lines.append(f"\nP/L Diagram: {strategy_name}")
lines.append("-" * width)
# Y-axis levels
levels = np.linspace(max_pnl, min_pnl, height)
for level in levels:
if abs(level) < (max_pnl - min_pnl) * 0.05:
label = f" 0 |" # Zero line
else:
label = f"{level:6.0f} |"
row = label
for i in range(width - len(label)):
idx = int(i / (width - len(label)) * len(price_range))
pnl = pnl_values[idx]
price = price_range[idx]
# Determine character
if abs(pnl - level) < (max_pnl - min_pnl) / height:
if pnl > 0:
char = '█' # Profit
elif pnl < 0:
char = '░' # Loss
else:
char = '─' # Breakeven
elif abs(level) < (max_pnl - min_pnl) * 0.05:
char = '─' # Zero line
elif abs(price - current_price) < (price_range[-1] - price_range[0]) * 0.02:
char = '│' # Current price line
else:
char = ' '
row += char
lines.append(row)
lines.append(" " * 6 + "|" + "-" * (width - 6))
lines.append(" " * 6 + f"${price_range[0]:.0f}" + " " * (width - 20) + f"${price_range[-1]:.0f}")
lines.append(" " * (width // 2 - 5) + "Stock Price")
return "\n".join(lines)Example Output:
P/L Diagram: Bull Call Spread $180/$185
------------------------------------------------------------
+2500 | ████████████████████
| ██████
| ██████
| ██████
0 | ──────
| ░░░░░░
|░░░░░░
-2500 |░░░░░
|____________________________________________________________
$126 $180 $234
Stock Price
Legend: █ Profit ░ Loss ── Breakeven │ Current Price股价与盈亏的可视化展示:
python
def generate_pnl_diagram(price_range, pnl_values, current_price, width=60, height=15):
"""生成ASCII盈亏示意图"""
# 归一化到图表尺寸
max_pnl = max(pnl_values)
min_pnl = min(pnl_values)
lines = []
lines.append(f"\n盈亏示意图: {strategy_name}")
lines.append("-" * width)
# Y轴刻度
levels = np.linspace(max_pnl, min_pnl, height)
for level in levels:
if abs(level) < (max_pnl - min_pnl) * 0.05:
label = f" 0 |" # 零线
else:
label = f"{level:6.0f} |"
row = label
for i in range(width - len(label)):
idx = int(i / (width - len(label)) * len(price_range))
pnl = pnl_values[idx]
price = price_range[idx]
# 确定显示字符
if abs(pnl - level) < (max_pnl - min_pnl) / height:
if pnl > 0:
char = '█' # 盈利
elif pnl < 0:
char = '░' # 亏损
else:
char = '─' # 盈亏平衡
elif abs(level) < (max_pnl - min_pnl) * 0.05:
char = '─' # 零线
elif abs(price - current_price) < (price_range[-1] - price_range[0]) * 0.02:
char = '│' # 当前股价线
else:
char = ' '
row += char
lines.append(row)
lines.append(" " * 6 + "|" + "-" * (width - 6))
lines.append(" " * 6 + f"${price_range[0]:.0f}" + " " * (width - 20) + f"${price_range[-1]:.0f}")
lines.append(" " * (width // 2 - 5) + "股价")
return "\n".join(lines)示例输出:
盈亏示意图: Bull Call Spread 180/185美元
------------------------------------------------------------
+2500 | ████████████████████
| ██████
| ██████
| ██████
0 | ──────
| ░░░░░░
|░░░░░░
-2500 |░░░░░
|____________________________________________________________
$126 $180 $234
股价
图例: █ 盈利 ░ 亏损 ── 盈亏平衡 │ 当前股价Step 7: Strategy-Specific Analysis
步骤7:策略专属分析
Provide tailored guidance based on strategy type:
Covered Call:
Income Strategy: Generate premium while capping upside
Setup:
- Own 100 shares of AAPL @ $180
- Sell 1x $185 call (30 DTE) for $3.50
Max Profit: $850 (Stock at $185+ = $5 stock gain + $3.50 premium)
Max Loss: Unlimited downside (stock ownership)
Breakeven: $176.50 (Cost basis - premium received)
Greeks:
- Delta: -0.30 (reduces stock delta from 1.00 to 0.70)
- Theta: +$8/day (time decay benefit)
Assignment Risk: If AAPL > $185 at expiration, shares called away
When to Use:
- Neutral to slightly bullish
- Want income in sideways market
- Willing to sell stock at $185
Exit Plan:
- Buy back call if stock rallies strongly (preserve upside)
- Let expire if stock stays below $185
- Roll to next month if want to keep sharesProtective Put:
Insurance Strategy: Limit downside while keeping upside
Setup:
- Own 100 shares of AAPL @ $180
- Buy 1x $175 put (30 DTE) for $2.00
Max Profit: Unlimited (stock can rise infinitely)
Max Loss: -$7 per share = ($5 stock loss + $2 premium)
Breakeven: $182 (Cost basis + premium paid)
Greeks:
- Delta: +0.80 (stock delta 1.00 - put delta 0.20)
- Theta: -$6/day (time decay cost)
Protection: Guaranteed to sell at $175, no matter how far stock falls
When to Use:
- Own stock, worried about short-term drop
- Earnings coming up, want protection
- Alternative to stop-loss (can't be stopped out)
Cost: "Insurance premium" - typically 1-3% of stock value
Exit Plan:
- Let expire worthless if stock rises (cost of insurance)
- Exercise put if stock falls below $175
- Sell put if stock drops but want to keep sharesIron Condor:
Range-Bound Strategy: Profit from low volatility
Setup (example on AAPL @ $180):
- Sell $175 put for $1.50
- Buy $170 put for $0.50
- Sell $185 call for $1.50
- Buy $190 call for $0.50
Net Credit: $2.00 ($200 per iron condor)
Max Profit: $200 (if stock stays between $175-$185)
Max Loss: $300 (if stock moves outside $170-$190)
Breakevens: $173 and $187
Profit Range: $175 to $185 (58% probability)
Greeks:
- Delta: ~0 (market neutral)
- Theta: +$15/day (time decay benefit)
- Vega: -$25 (short volatility)
When to Use:
- Expect low volatility, range-bound movement
- After big move, think consolidation
- High IV environment (sell expensive options)
Risk: Unlimited if one side tested
- Use stop loss at 2x credit received (exit at -$400)
Adjustments:
- If tested on one side, roll that side out in time
- Close early at 50% max profit to reduce tail risk根据策略类型提供定制化指导:
Covered Call:
收益类策略:赚取权利金的同时限制上行收益
设置:
- 持有100股AAPL,股价180美元
- 卖出1张185美元看涨期权(30天到期),权利金3.50美元
最大盈利:850美元(股价≥185美元时,5美元股票收益+3.50美元权利金)
最大损失:无限(持有股票的下行风险)
盈亏平衡点:176.50美元(成本价-收取的权利金)
Greeks:
- Delta: -0.30(将股票Delta从1.00降至0.70)
- Theta: +8美元/天(时间衰减带来收益)
被行权风险:若到期时AAPL股价高于185美元,股票将被行权收回
适用场景:
- 中性至轻度看涨
- 横盘市场中希望赚取收益
- 愿意以185美元卖出股票
退出计划:
- 若股价大幅上涨,买回看涨期权以保留上行收益
- 若股价维持在185美元以下,任由期权到期
- 若希望继续持有股票,将期权展期至下一期Protective Put:
对冲类策略:限制下行风险的同时保留上行收益
设置:
- 持有100股AAPL,股价180美元
- 买入1张175美元看跌期权(30天到期),权利金2.00美元
最大盈利:无限(股价可无限上涨)
最大损失:每股7美元(5美元股票损失+2美元权利金)
盈亏平衡点:182美元(成本价+支付的权利金)
Greeks:
- Delta: +0.80(股票Delta 1.00 - 看跌期权Delta 0.20)
- Theta: -6美元/天(时间衰减带来损失)
对冲效果:无论股价下跌多少,都能以175美元卖出股票
适用场景:
- 持有股票,担忧短期下跌
- 财报即将发布,希望对冲风险
- 替代止损单(不会被止损出局)
成本:“对冲保费”通常为股票价值的1-3%
退出计划:
- 若股价上涨,任由期权到期作废(对冲成本)
- 若股价下跌至175美元以下,行权卖出股票
- 若股价下跌但希望继续持有股票,卖出看跌期权Iron Condor:
区间震荡策略:低波动率环境下盈利
设置(AAPL股价180美元示例):
- 卖出175美元看跌期权,权利金1.50美元
- 买入170美元看跌期权,权利金0.50美元
- 卖出185美元看涨期权,权利金1.50美元
- 买入190美元看涨期权,权利金0.50美元
净权利金收入:2.00美元(每个Iron Condor 200美元)
最大盈利:200美元(股价维持在175-185美元之间)
最大损失:300美元(股价突破170-190美元区间)
盈亏平衡点:173美元与187美元
盈利区间:175-185美元(概率58%)
Greeks:
- Delta: ~0(市场中性)
- Theta: +15美元/天(时间衰减带来收益)
- Vega: -25美元(做空波动率)
适用场景:
- 预期低波动率、区间震荡行情
- 大幅波动后,认为市场将进入盘整
- 高IV环境(卖出高估的期权)
风险:若某一侧被突破,风险无限
- 使用止损:当损失达到权利金的2倍时平仓(亏损400美元时退出)
调整策略:
- 若某一侧面临压力,将该侧展期至更远期
- 当盈利达到最大盈利的50%时提前平仓,降低尾部风险Step 8: Earnings Strategy Analysis
步骤8:财报季策略分析
Integration with Earnings Calendar:
When user asks about earnings strategies, fetch earnings date:
python
from earnings_calendar import get_next_earnings_date
earnings_date = get_next_earnings_date("AAPL")
days_to_earnings = (earnings_date - today).daysPre-Earnings Strategies:
Long Straddle/Strangle:
Setup (AAPL @ $180, earnings in 7 days):
- Buy $180 call for $5.00
- Buy $180 put for $4.50
- Total Cost: $9.50
Thesis: Expect big move (>5%) but unsure of direction
Breakevens: $170.50 and $189.50
Profit if: Stock moves >$9.50 in either direction
Greeks:
- Delta: ~0 (neutral)
- Vega: +$50 (long volatility)
- Theta: -$25/day (time decay hurts)
IV Crush Risk: ⚠️ CRITICAL
- Pre-earnings IV: 40% (elevated)
- Post-earnings IV: 25% (typical)
- IV drop: -15 points = -$750 loss even if stock doesn't move!
Analysis:
- Implied Move: √(DTE/365) × IV × Stock Price
= √(7/365) × 0.40 × 180 = ±$10.50
- Breakeven Move Needed: ±$9.50
- Probability Profit: ~30-40% (implied move > breakeven move)
Recommendation:
✅ Consider if you expect >10% move (larger than implied)
❌ Avoid if expect normal ~5% earnings move (IV crush will hurt)
Alternative: Buy further OTM strikes to reduce cost
- $175/$185 strangle cost $4.00 (need >$8 move, but cheaper)Short Iron Condor:
Setup (AAPL @ $180, earnings in 7 days):
- Sell $170/$175 put spread for $2.00
- Sell $185/$190 call spread for $2.00
- Net Credit: $4.00
Thesis: Expect stock to stay range-bound ($175-$185)
Profit Zone: $175 to $185
Max Profit: $400
Max Loss: $100
IV Crush Benefit: ✅
- Short high IV before earnings
- IV drops after earnings → profit on vega
- Even if stock moves slightly, IV drop helps
Greeks:
- Delta: ~0 (market neutral)
- Vega: -$40 (short volatility - good here!)
- Theta: +$20/day
Recommendation:
✅ Good if expect normal earnings reaction (<8% move)
✅ Benefit from IV crush regardless of direction
⚠️ Risk if stock gaps outside range (>10% move)
Exit Plan:
- Close next day if IV crushed (capture profit early)
- Use stop loss if one side tested (-2x credit)与财报日历的集成:
当用户询问财报季策略时,获取财报日期:
python
from earnings_calendar import get_next_earnings_date
earnings_date = get_next_earnings_date("AAPL")
days_to_earnings = (earnings_date - today).days财报前策略:
Long Straddle/Strangle:
设置(AAPL股价180美元,7天后发布财报):
- 买入180美元看涨期权,权利金5.00美元
- 买入180美元看跌期权,权利金4.50美元
- 总成本:9.50美元
逻辑:预期股价大幅波动(>5%)但方向不确定
盈亏平衡点:170.50美元与189.50美元
盈利条件:股价波动超过9.50美元
Greeks:
- Delta: ~0(中性)
- Vega: +50美元(做多波动率)
- Theta: -25美元/天(时间衰减带来损失)
IV暴跌风险:⚠️ 关键风险
- 财报前IV:40%(高位)
- 财报后IV:25%(正常水平)
- IV下跌15个点:即使股价不动,也会损失750美元!
分析:
- 隐含波动:√(到期天数/365) × IV × 股价
= √(7/365) × 0.40 × 180 = ±10.50美元
- 所需盈亏平衡波动:±9.50美元
- 盈利概率:约30-40%(隐含波动>盈亏平衡波动)
建议:
✅ 若预期波动>10%(大于隐含波动)可考虑
❌ 若预期正常5%左右的财报波动,避免使用(IV暴跌会造成损失)
替代方案:买入更深虚值的合约以降低成本
- 175/185美元Strangle成本4.00美元(需要波动超过8美元,但成本更低)Short Iron Condor:
设置(AAPL股价180美元,7天后发布财报):
- 卖出170/175美元看跌价差,权利金2.00美元
- 卖出185/190美元看涨价差,权利金2.00美元
- 净权利金收入:4.00美元
逻辑:预期股价维持区间震荡(175-185美元)
盈利区间:175-185美元
最大盈利:400美元
最大损失:100美元
IV暴跌收益:✅
- 财报前卖出高IV期权
- 财报后IV下跌,从Vega中获利
- 即使股价小幅波动,IV下跌也会带来收益
Greeks:
- Delta: ~0(市场中性)
- Vega: -40美元(做空波动率,此处有利!)
- Theta: +20美元/天
建议:
✅ 若预期正常财报反应(波动<8%),适合使用
✅ 无论股价方向如何,均可从IV暴跌中获利
⚠️ 风险:若股价跳空突破区间(波动>10%)
退出计划:
- 财报后次日IV暴跌时平仓,锁定收益
- 若某一侧面临压力,当损失达到权利金的2倍时止损Step 9: Risk Management Guidance
步骤9:风险管理指导
Position Sizing:
Account Size: $50,000
Risk Tolerance: 2% per trade = $1,000 max risk
Iron Condor Example:
- Max loss per spread: $300
- Max contracts: $1,000 / $300 = 3 contracts
- Actual position: 3 iron condors
Bull Call Spread Example:
- Debit paid: $2.50 per spread
- Max contracts: $1,000 / $250 = 4 contracts
- Actual position: 4 spreadsPortfolio Greeks Management:
Portfolio Guidelines:
- Delta: -10 to +10 (mostly neutral)
- Theta: Positive preferred (seller advantage)
- Vega: Monitor if >$500 (IV risk)
Current Portfolio:
- Delta: +5 (slightly bullish)
- Theta: +$150/day (collecting $150 daily)
- Vega: -$300 (short volatility)
Interpretation:
✅ Neutral delta (safe)
✅ Positive theta (time working for you)
⚠️ Short vega: If IV spikes, lose $300 per 1% IV increase
→ Reduce short premium positions if VIX risingAdjustments and Exits:
Exit Rules by Strategy:
Covered Call:
- Profit: 50-75% of max profit
- Loss: Stock drops >5%, buy back call to preserve upside
- Time: 7-10 DTE, roll to avoid assignment
Spreads:
- Profit: 50% of max profit (close early, reduce tail risk)
- Loss: 2x debit paid (cut losses early)
- Time: 21 DTE, close or roll (avoid gamma risk)
Iron Condor:
- Profit: 50% of credit (close early common)
- Loss: One side tested, 2x credit lost
- Adjustment: Roll tested side out in time
Straddle/Strangle:
- Profit: Stock moved >breakeven, close immediately
- Loss: Theta eating position, stock not moving
- Time: Day after earnings (if earnings play)仓位规模:
账户规模:50000美元
风险容忍度:每笔交易2% = 最大风险1000美元
Iron Condor示例:
- 每个价差的最大损失:300美元
- 最大合约数量:1000 / 300 = 3张合约
- 实际仓位:3个Iron Condor
Bull Call Spread示例:
- 支付的权利金:每笔价差2.50美元
- 最大合约数量:1000 / 250 = 4张合约
- 实际仓位:4个价差投资组合Greeks管理:
投资组合准则:
- Delta: -10至+10(基本中性)
- Theta: 正收益为佳(卖方优势)
- Vega: 若超过500美元需监控(IV风险)
当前投资组合:
- Delta: +5(轻度看涨)
- Theta: +150美元/天(每日赚取150美元)
- Vega: -300美元(做空波动率)
解读:
✅ Delta中性(安全)
✅ Theta为正(时间站在你这边)
⚠️ 做空Vega:若IV飙升,每上涨1%损失300美元
→ 若VIX上涨,减少空头权利金仓位调整与退出:
各策略退出规则:
Covered Call:
- 盈利:达到最大盈利的50-75%时平仓
- 损失:股价下跌超过5%时,买回看涨期权以保留上行收益
- 时间:到期前7-10天,展期以避免被行权
价差策略:
- 盈利:达到最大盈利的50%时提前平仓,降低尾部风险
- 损失:损失达到权利金的2倍时止损
- 时间:到期前21天,平仓或展期(避免Gamma风险)
Iron Condor:
- 盈利:达到权利金的50%时提前平仓(常见操作)
- 损失:某一侧面临压力,损失达到权利金的2倍时止损
- 调整:将面临压力的一侧展期至更远期
跨式/宽跨式期权:
- 盈利:股价突破盈亏平衡点后立即平仓
- 损失:Theta侵蚀仓位且股价未波动时止损
- 时间:财报后次日平仓(若为财报季策略)Output Format
输出格式
Strategy Analysis Report Template:
markdown
undefined策略分析报告模板:
markdown
undefinedOptions Strategy Analysis: [Strategy Name]
期权策略分析:[策略名称]
Symbol: [TICKER]
Strategy: [Strategy Type]
Expiration: [Date] ([DTE] days)
Contracts: [Number]
股票代码: [TICKER]
策略类型: [Strategy Type]
到期日期: [Date]([DTE]天)
合约数量: [Number]
Strategy Setup
策略设置
Leg Details
期权腿详情
| Leg | Type | Strike | Price | Position | Quantity |
|---|---|---|---|---|---|
| 1 | Call | $180 | $5.00 | Long | 1 |
| 2 | Call | $185 | $2.50 | Short | 1 |
Net Debit/Credit: $2.50 debit ($250 total for 1 spread)
| 腿 | 类型 | 执行价 | 价格 | 仓位 | 数量 |
|---|---|---|---|---|---|
| 1 | Call | $180 | $5.00 | 多头 | 1 |
| 2 | Call | $185 | $2.50 | 空头 | 1 |
净权利金收支: 2.50美元支出(1笔价差总计250美元)
Profit/Loss Analysis
盈亏分析
Max Profit: $250 (at $185+)
Max Loss: -$250 (at $180-)
Breakeven: $182.50
Risk/Reward Ratio: 1:1
Probability Analysis:
- Probability of Profit: ~55% (stock above $182.50)
- Expected Value: $25 (simplified)
最大盈利: 250美元(股价≥185美元时)
最大损失: -250美元(股价≤180美元时)
盈亏平衡点: 182.50美元
风险收益比: 1:1
概率分析:
- 盈利概率:约55%(股价高于182.50美元时)
- 预期收益:25美元(简化计算)
P/L Diagram
盈亏示意图
[ASCII art diagram here]
[ASCII示意图]
Greeks Analysis
Greeks分析
Position Greeks (1 spread)
仓位Greeks(1笔价差)
- Delta: +0.20 (gains $20 if stock +$1)
- Gamma: +0.03 (delta increases by 0.03 if stock +$1)
- Theta: -$5/day (loses $5 per day from time decay)
- Vega: +$8 (gains $8 if IV increases 1%)
- Delta: +0.20(股价上涨1美元时盈利20美元)
- Gamma: +0.03(股价上涨1美元时Delta增加0.03)
- Theta: -5美元/天(每日因时间流逝损失5美元)
- Vega: +8美元(IV上涨1%时盈利8美元)
Interpretation
解读
- Directional Bias: Slightly bullish (positive delta)
- Time Decay: Working against you (negative theta)
- Volatility: Benefits from IV increase (positive vega)
- 方向性偏向: 轻度看涨(Delta为正)
- 时间衰减: 对投资者不利(Theta为负)
- 波动率: IV上涨时获利(Vega为正)
Risk Assessment
风险评估
Maximum Risk
最大风险
Scenario: Stock falls below $180
Max Loss: -$250 (100% of premium paid)
% of Account: 0.5% (if $50k account)
场景: 股价跌破180美元
最大损失: -250美元(支付权利金的100%)
账户占比: 0.5%(若账户规模为50000美元)
Assignment Risk
被行权风险
Early Assignment: Low (calls have time value)
At Expiration: Manage positions if in-the-money
提前行权: 低概率(看涨期权仍有时间价值)
到期时: 若期权处于实值状态,需管理仓位
Trade Management
交易管理
Entry
入场条件
✅ Enter if: [Conditions]
- Stock price $178-$182
- IV below 30%
-
21 DTE
✅ 入场时机:
- 股价在178-182美元之间
- IV低于30%
- 到期时间21-45天
Profit Taking
止盈
- Target 1: 50% profit ($125) - Close half
- Target 2: 75% profit ($187.50) - Close all
- 目标1: 盈利50%(125美元)- 平仓一半仓位
- 目标2: 盈利75%(187.50美元)- 全部平仓
Stop Loss
止损
- Trigger: Stock falls below $177 (-$150 loss)
- Action: Close position immediately
- 触发条件: 股价跌破177美元(损失150美元)
- 操作: 立即平仓
Adjustments
调整策略
- If stock rallies to $184, consider rolling short call higher
- If stock drops to $179, add second spread at $175/$180
- 若股价上涨至184美元,考虑将空头看涨期权向上展期
- 若股价下跌至179美元,新增1笔175/180美元的价差
Suitability
适用性
When to Use This Strategy
适用场景
✅ Moderately bullish on AAPL
✅ Expect upside to $185-$190
✅ Want defined risk
✅ 21-45 DTE timeframe
✅ 对AAPL持中度看涨态度
✅ 预期股价上涨至185-190美元
✅ 希望风险可控
✅ 21-45天到期时间
When to Avoid
避免场景
❌ Very bullish (buy stock or long call instead)
❌ High IV environment (wait for IV to drop)
❌ Earnings in <7 days (IV crush risk)
❌ 极度看涨(直接买入股票或看涨期权)
❌ 高IV环境(等待IV回落)
❌ 财报前7天内(IV暴跌风险)
Alternatives Comparison
替代策略对比
| Strategy | Max Profit | Max Loss | Complexity | When Better |
|---|---|---|---|---|
| Bull Call Spread | $250 | -$250 | Medium | Moderately bullish |
| Long Call | Unlimited | -$500 | Low | Very bullish |
| Covered Call | $850 | Unlimited | Medium | Own stock already |
| Bull Put Spread | $300 | -$200 | Medium | Want credit spread |
Recommendation: Bull call spread is good balance of risk/reward for moderate bullish thesis.
Disclaimer: This is theoretical analysis using Black-Scholes pricing. Actual market prices may differ. Trade at your own risk. Options are complex instruments with significant loss potential.
**File Naming Convention:**options_analysis_[TICKER][STRATEGY][DATE].md
Example: `options_analysis_AAPL_BullCallSpread_2025-11-08.md`| 策略 | 最大盈利 | 最大损失 | 复杂度 | 更优场景 |
|---|---|---|---|---|
| Bull Call Spread | $250 | -$250 | 中等 | 中度看涨 |
| Long Call | 无限 | -$500 | 低 | 极度看涨 |
| Covered Call | $850 | 无限 | 中等 | 已持有股票 |
| Bull Put Spread | $300 | -$200 | 中等 | 希望赚取权利金 |
建议: Bull Call Spread在中度看涨逻辑下实现了风险与收益的良好平衡。
免责声明:本分析基于Black-Scholes定价模型的理论计算,实际市场价格可能有所不同。交易需自行承担风险。期权为复杂金融工具,具有较高的潜在损失风险。
**文件命名规范:**options_analysis_[TICKER][STRATEGY][DATE].md
示例:`options_analysis_AAPL_BullCallSpread_2025-11-08.md`Key Principles
核心原则
Theoretical Pricing Limitations
理论定价的局限性
What Users Should Know:
-
Black-Scholes Assumptions:
- European-style options (can't exercise early)
- Constant volatility (IV changes in reality)
- No transaction costs
- Continuous trading
-
Real vs Theoretical:
- Bid-ask spread: Actual cost higher than theoretical
- American options: Can be exercised early (especially ITM puts)
- Liquidity: Wide markets on illiquid options
- Dividends: Ex-dividend dates affect pricing
-
Best Practices:
- Use as educational tool and comparative analysis
- Get real quotes from broker before trading
- Understand theoretical price ≈ mid-market price
- Account for commissions and slippage
用户需了解:
-
Black-Scholes假设:
- 欧式期权(不可提前行权)
- 波动率恒定(实际中IV会变化)
- 无交易成本
- 连续交易
-
实际与理论的差异:
- 买卖价差:实际成本高于理论价格
- 美式期权:可提前行权(尤其是实值看跌期权)
- 流动性:流动性差的期权买卖价差较大
- 股息:除息日会影响定价
-
最佳实践:
- 将本工具用作教育与对比分析工具
- 交易前从经纪商获取实时报价
- 理解理论价格≈市场中间价
- 考虑佣金与滑点成本
Volatility Guidance
波动率指导
Historical vs Implied Volatility:
Historical Volatility (HV): What happened
- Calculated from past price movements
- Objective, based on data
- Available for free (FMP API)
Implied Volatility (IV): What market expects
- Derived from option prices
- Subjective, based on supply/demand
- Requires live options data (user provides)
Comparison:
- IV > HV: Options expensive (consider selling)
- IV < HV: Options cheap (consider buying)
- IV = HV: Fairly pricedIV Percentile:
User provides current IV, we calculate percentile:
python
undefined历史波动率(HV)与隐含波动率(IV):
历史波动率(HV):已发生的波动
- 从历史价格波动中计算
- 客观,基于数据
- 可免费获取(FMP API)
隐含波动率(IV):市场预期的波动
- 从期权价格中推导
- 主观,基于供需关系
- 需要实时期权数据(由用户提供)
对比:
- IV > HV:期权高估(考虑卖出)
- IV < HV:期权低估(考虑买入)
- IV = HV:定价合理IV百分位:
用户提供当前IV后,计算其百分位:
python
undefinedFetch 1-year HV data
获取1年的HV数据
historical_hvs = calculate_hv_series(prices_1yr, window=30)
historical_hvs = calculate_hv_series(prices_1yr, window=30)
Calculate IV percentile
计算IV百分位
iv_percentile = percentileofscore(historical_hvs, current_iv)
if iv_percentile > 75:
guidance = "High IV - consider selling premium (credit spreads, iron condors)"
elif iv_percentile < 25:
guidance = "Low IV - consider buying options (long calls/puts, debit spreads)"
else:
guidance = "Normal IV - any strategy appropriate"
undefinediv_percentile = percentileofscore(historical_hvs, current_iv)
if iv_percentile > 75:
guidance = "高IV - 考虑卖出权利金(信用价差、Iron Condor)"
elif iv_percentile < 25:
guidance = "低IV - 考虑买入期权(看涨/看跌期权、借记价差)"
else:
guidance = "正常IV - 任何策略均适用"
undefinedIntegration with Other Skills
与其他工具的集成
Earnings Calendar:
- Fetch earnings dates automatically
- Suggest earnings-specific strategies
- Calculate days to earnings (DTE critical for IV)
- Warn about IV crush risk
Technical Analyst:
- Use support/resistance for strike selection
- Trend analysis for directional strategies
- Breakout potential for straddle/strangle timing
US Stock Analysis:
- Fundamental analysis for longer-term strategies (LEAPS)
- Dividend yield for covered call/put analysis
- Earnings quality for earnings plays
Bubble Detector:
- High bubble risk → focus on protective puts
- Low risk → bullish strategies
- Critical risk → avoid long premium (theta hurts)
Portfolio Manager:
- Track options positions alongside stock positions
- Aggregate Greeks across portfolio
- Options as hedging tool for stock positions
财报日历:
- 自动获取财报日期
- 推荐财报专属策略
- 计算距离财报的天数(DTE对IV至关重要)
- 预警IV暴跌风险
技术分析工具:
- 利用支撑/阻力位选择执行价
- 趋势分析用于方向性策略
- 突破潜力用于跨式/宽跨式期权的时机选择
美股分析工具:
- 基本面分析用于长期策略(LEAPS)
- 股息率用于Covered Call/Put分析
- 财报质量用于财报季交易
泡沫检测工具:
- 高泡沫风险→重点关注Protective Put
- 低风险→看涨策略
- 极高风险→避免买入权利金(Theta会造成损失)
投资组合管理工具:
- 跟踪期权仓位与股票仓位
- 汇总投资组合的Greeks
- 将期权作为股票仓位的对冲工具
Important Notes
重要说明
- All analysis in English
- Educational focus: Strategies explained clearly
- Theoretical pricing: Black-Scholes approximation
- User IV input: Optional, defaults to HV
- No real-time data required: FMP Free tier sufficient
- Dependencies: Python 3.8+, numpy, scipy, pandas
- 所有分析均为英文
- 教育导向:清晰解释策略
- 理论定价:Black-Scholes近似计算
- 用户IV输入:可选,默认使用HV
- 无需实时数据:FMP免费 tier足够使用
- 依赖项:Python 3.8+, numpy, scipy, pandas
Common Use Cases
常见使用场景
Use Case 1: Learn Strategy
User: "Explain a covered call"
Workflow:
1. Load strategy reference (references/strategies_guide.md)
2. Explain concept, risk/reward, when to use
3. Simulate example on AAPL
4. Show P/L diagram
5. Compare to alternativesUse Case 2: Analyze Specific Trade
User: "Analyze $180/$185 bull call spread on AAPL, 30 days"
Workflow:
1. Fetch AAPL price from FMP
2. Calculate HV or ask user for IV
3. Price both options (Black-Scholes)
4. Calculate Greeks
5. Simulate P/L
6. Generate analysis reportUse Case 3: Earnings Strategy
User: "Should I trade options before NVDA earnings?"
Workflow:
1. Fetch NVDA earnings date (Earnings Calendar)
2. Calculate days to earnings
3. Estimate IV percentile (if user provides IV)
4. Suggest straddle/strangle vs iron condor
5. Warn about IV crush
6. Simulate both strategiesUse Case 4: Portfolio Greeks Check
User: "What are my total portfolio Greeks?"
Workflow:
1. User provides current positions
2. Calculate Greeks for each position
3. Sum Greeks across portfolio
4. Assess overall exposure
5. Suggest adjustments if needed场景1:学习策略
用户:“解释Covered Call”
流程:
1. 加载策略参考文档(references/strategies_guide.md)
2. 解释概念、风险收益、适用场景
3. 模拟AAPL的示例
4. 展示盈亏示意图
5. 对比替代策略场景2:分析特定交易
用户:“分析AAPL的180/185美元Bull Call Spread,30天到期”
流程:
1. 从FMP获取AAPL股价
2. 计算HV或询问用户IV
3. 使用Black-Scholes为两个期权定价
4. 计算Greeks
5. 模拟盈亏
6. 生成分析报告场景3:财报季策略
用户:“NVDA财报前我应该交易期权吗?”
流程:
1. 从财报日历获取NVDA的财报日期
2. 计算距离财报的天数
3. 估算IV百分位(若用户提供IV)
4. 推荐跨式/宽跨式期权 vs Iron Condor
5. 预警IV暴跌风险
6. 模拟两种策略场景4:投资组合Greeks检查
用户:“我的投资组合总Greeks是多少?”
流程:
1. 用户提供当前仓位
2. 计算每个仓位的Greeks
3. 汇总所有仓位的Greeks
4. 评估整体敞口
5. 必要时建议调整Troubleshooting
故障排除
Problem: IV not available
- Solution: Use HV as proxy, note to user
- Ask user to provide IV from broker platform
Problem: Negative option price
- Solution: Check inputs (strike vs stock price)
- Deep ITM options may have numerical issues
Problem: Greeks seem wrong
- Solution: Verify inputs (T, sigma, r)
- Check if using annual vs daily values
Problem: Strategy too complex
- Solution: Break into legs, analyze separately
- Refer to references for strategy details
问题:IV不可用
- 解决方案:使用HV作为替代,并提示用户
- 询问用户从经纪商平台提供IV
问题:期权价格为负
- 解决方案:检查输入(执行价与股价的关系)
- 深度实值期权可能存在数值计算问题
问题:Greeks看起来异常
- 解决方案:验证输入(到期时间、波动率、利率)
- 检查是否混用了年化与日度数据
问题:策略过于复杂
- 解决方案:拆分为单个期权腿,分别分析
- 参考策略详情文档
Resources
资源
References:
- - All 17+ strategies explained
references/strategies_guide.md - - Greeks deep dive
references/greeks_explained.md - - HV vs IV, when to trade
references/volatility_guide.md
Scripts:
- - Pricing engine and Greeks
scripts/black_scholes.py - - Strategy simulation
scripts/strategy_analyzer.py - - Earnings-specific analysis
scripts/earnings_strategy.py
External Resources:
- Options Playbook: https://www.optionsplaybook.com/
- CBOE Education: https://www.cboe.com/education/
- Black-Scholes Calculator: Various online tools for verification
Version: 1.0
Last Updated: 2025-11-08
Dependencies: Python 3.8+, numpy, scipy, pandas, requests
API: FMP API (Free tier sufficient)
参考文档:
- - 所有17+种策略的详细解释
references/strategies_guide.md - - Greeks深度解析
references/greeks_explained.md - - HV与IV对比,交易时机
references/volatility_guide.md
脚本:
- - 定价引擎与Greeks计算
scripts/black_scholes.py - - 策略模拟
scripts/strategy_analyzer.py - - 财报季专属分析
scripts/earnings_strategy.py
外部资源:
- Options Playbook: https://www.optionsplaybook.com/
- CBOE Education: https://www.cboe.com/education/
- Black-Scholes计算器:多种在线工具用于验证
版本:1.0
最后更新:2025-11-08
依赖项:Python 3.8+, numpy, scipy, pandas, requests
API:FMP API(免费 tier足够使用)