mcpField
O
options-strategy-advisor

options-strategy-advisor

github.com/mphinanceその他3287 回インストール3 日前に更新
リポジトリ

options-strategy-advisor について

options-strategy-advisorは、オプションポジションや戦略を評価するトレーダー向けの分析・学習スキルです。理論価格モデルでGreeksを計算し、FMPデータまたは手入力を使って損益をシミュレーションします。

主な機能

  1. 01Black-Scholesによる価格とGreeksの計算
  2. 02戦略損益のシミュレーション
  3. 03ポジションリスクとサイズの分析
  4. 04決算前戦略の評価
  5. 05戦略とリスク指標の解説

活用シーン

  1. 01銘柄に応じたオプション戦略の比較
  2. 02スプレッドの損益と損益分岐点の推定
  3. 03ポジションのGreeksエクスポージャー確認
  4. 04決算前のオプション戦略の検討

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/mphinance/alpha-skills --skill options-strategy-advisor

インストール後、Claude Code で/options-strategy-advisorを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

README.md
references/
black_scholes_methodology.md
scripts/
black_scholes.py
scripts/tests/
conftest.py
test_black_scholes.py

詳細

オプション戦略アドバイザー

概要

このスキルは、理論的な価格モデルを使用して、包括的なオプション戦略の分析と教育を提供します。リアルタイムの市場データ購読を必要とせずに、トレーダーがオプション戦略を理解し、分析し、シミュレーションできるように支援します。

主な機能:

  • ブラック・ショールズ価格計算: 理論上のオプション価格とギリシャ指標の計算
  • 戦略シミュレーション: 主要なオプション戦略の損益分析
  • 決算戦略: 決算カレンダーと連携した決算前のボラティリティ・プレイ
  • リスク管理: ポジションサイジング、ギリシャ指標のエクスポージャー、最大損失・最大利益の分析
  • 教育重視: 戦略とリスク指標に関する詳細な説明

データソース:

  • FMP API: 株価、ヒストリカル・ボラティリティ、配当、決算日
  • ユーザー入力: インプライド・ボラティリティ (IV)、無リスク金利
  • 理論モデル: 価格計算とギリシャ指標のためのブラック・ショールズ

前提条件

必須:

  • numpy、scipy、requests を備えた Python 3.8 以上

オプション:

  • FMP API キー (リアルタイムの株価とヒストリカル・ボラティリティ用)
    • FMP_API_KEY 環境変数または --api-key 引数で設定します
    • API キーがない場合: 株価とボラティリティには手動入力を使用します

インストール:

pip install numpy scipy requests

クイックスタート例:

# Basic call option pricing (no API key needed)
python3 scripts/black_scholes.py

# With FMP API key for real-time data
python3 scripts/black_scholes.py --ticker AAPL --api-key $FMP_API_KEY

# Custom option parameters
python3 scripts/black_scholes.py --stock-price 180 --strike 185 --days 30 --volatility 0.25

# Put option analysis
python3 scripts/black_scholes.py --stock-price 180 --strike 175 --days 30 --option-type put

このスキルを使用する場面

次の場合にこのスキルを使用します:

  • ユーザーがオプション戦略について尋ねる (「カバードコールとは何ですか?」「アイアンコンドルはどのように機能しますか?」)
  • ユーザーが戦略の損益をシミュレーションしたい (「ブルコールスプレッドの最大利益はいくらですか?」)
  • ユーザーがギリシャ指標の分析を必要とする (「デルタ・エクスポージャーはどのくらいですか?」)
  • ユーザーが決算戦略について尋ねる (「決算前にストラドルを買うべきですか?」)
  • ユーザーが戦略を比較したい (「カバードコールとプロテクティブプットの比較は?」)
  • ユーザーがポジションサイジングのガイダンスを必要とする (「何契約取引すべきですか?」)
  • ユーザーがボラティリティについて尋ねる (「今 IV は高いですか?」)

リクエストの例:

  • 「AAPL のカバードコールを分析してください」
  • 「MSFT の $100/$105 ブルコールスプレッドの損益はいくらですか?」
  • 「NVDA の決算前にストラドルを取引すべきですか?」
  • 「アイアンコンドルのポジションのギリシャ指標を計算してください」
  • 「下落保護のためのプロテクティブプットとカバードコールを比較してください」

対応する戦略

インカム戦略
  1. カバードコール - 株を保有し、コールを売却 (インカムを生成、上昇余地を制限)
  2. キャッシュ・セキュアード・プット - 現金を裏付けにプットを売却 (プレミアムを収集、株を買う意欲がある)
  3. プアマンズ・カバードコール - LEAPS コール + 短期コールの売り (資本効率が高い)
保護戦略
  1. プロテクティブプット - 株を保有し、プットを購入 (保険、下落を限定)
  2. カラー - 株を保有し、コールを売却 + プットを購入 (上昇・下落を限定)
方向性戦略
  1. ブルコールスプレッド - 低い権利行使価格のコールを買い、高い権利行使価格のコールを売る (強気の限定的なリスク・リターン)
  2. ブルプットスプレッド - 高い権利行使価格のプットを売り、低い権利行使価格のプットを買う (クレジットスプレッド、強気)
  3. ベアコールスプレッド - 低い権利行使価格のコールを売り、高い権利行使価格のコールを買う (クレジットスプレッド、弱気)
  4. ベアプットスプレッド - 高い権利行使価格のプットを買い、低い権利行使価格のプットを売る (弱気の限定的なリスク・リターン)
ボラティリティ戦略
  1. ロングストラドル - ATM コール + ATM プットを購入 (どちらの方向でも大きな動きから利益を得る)
  2. ロングストラングル - OTM コール + OTM プットを購入 (ストラドルより安価、より大きな動きが必要)
  3. ショートストラドル - ATM コール + ATM プットを売却 (動かないことから利益を得る、無制限のリスク)
  4. ショートストラングル - OTM コール + OTM プットを売却 (動かないことから利益を得る、より広い範囲)
レンジ相場戦略
  1. アイアンコンドル - ブルプットスプレッド + ベアコールスプレッド (レンジ内の動きから利益を得る)
  2. アイアンバタフライ - ATM ストラドルを売却し、OTM ストラングルを購入 (狭いレンジから利益を得る)
高度な戦略
  1. カレンダースプレッド - 短期オプションを売却し、長期オプションを購入 (時間減衰から利益を得る)
  2. ダイアゴナルスプレッド - 権利行使価格が異なるカレンダースプレッド (方向性 + 時間減衰)
  3. レシオスプレッド - アンバランスなスプレッド (一方のレッグの契約数が多い)

分析ワークフロー

ステップ 1:入力データの収集

ユーザーから必須:

  • ティッカーシンボル
  • 戦略の種類
  • 権利行使価格
  • 満期日
  • ポジションサイズ(契約数)

ユーザーから任意:

  • インプライド・ボラティリティ(IV)— 指定がない場合は、ヒストリカル・ボラティリティ(HV)を使用します
  • 無リスク金利 — デフォルトでは、現在の 3 か月物米国財務省短期証券利回りを使用します(2025 年時点で約 5.3%)

FMP API から取得:

  • 現在の株価
  • 過去の価格(HV の計算用)
  • 配当利回り
  • 次回の決算日(決算戦略の場合)

ユーザー入力の例:

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)
ステップ 2:ヒストリカル・ボラティリティを計算(IV が指定されていない場合)

目的: 過去の価格変動からボラティリティを推定します。

方法:

# Fetch 90 days of price data
prices = get_historical_prices("AAPL", days=90)

# Calculate daily returns
returns = np.log(prices / prices.shift(1))

# Annualized volatility
HV = returns.std() * np.sqrt(252)  # 252 trading days

出力:

  • ヒストリカル・ボラティリティ(年率)
  • ユーザーへの注記:「HV = 24.5% です。より正確な値を得るには、現在の市場 IV の使用をご検討ください」

ユーザーによる上書き:

  • ブローカーのプラットフォーム(ThinkorSwim、TastyTrade など)から IV を指定できます
  • スクリプトは --iv 28.0 パラメーターを受け付けます
ステップ 3:ブラック・ショールズモデルを使用してオプション価格を算出

ブラック・ショールズモデル:

ヨーロピアン型オプションの場合:

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 distribution

調整:

  • コールの場合、S から配当金の現在価値を差し引きます
  • アメリカン型オプション:近似値を使用するか、「ヨーロピアン型の価格設定のため、アメリカン型オプションの価値を過小評価する可能性があります」と注記します

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_price

各オプションレッグの出力:

  • 理論価格
  • 注記:「市場価格は、ビッド・アスク・スプレッドやアメリカン型とヨーロピアン型の価格設定の違いにより異なる場合があります」
ステップ 4:グリークスを計算

グリークスは、さまざまな要因に対するオプション価格の感応度を測定します。

デルタ(Δ): 株価が $1 変化した場合のオプション価格の変化

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)

ガンマ(Γ): 株価が $1 変化した場合のデルタの変化

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))

セータ(Θ): 1 日あたりのオプション価格の変化(時間価値の減少)

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 day

ベガ(ν): ボラティリティが 1% 変化した場合のオプション価格の変化

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%

ロー(ρ): 金利が 1% 変化した場合のオプション価格の変化

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%

ポジションのグリークス:

複数のレッグを持つ戦略では、すべてのレッグのグリークスを合計します。

# Example: Bull Call Spread
# Long 1x $180 call
# Short 1x $185 call

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)

グリークスの解釈:

グリークス意味例
デルタ方向性のエクスポージャーΔ = 0.50 → 株価が +$1 の場合、$50 の利益
ガンマデルタの加速Γ = 0.05 → 株価が +$1 の場合、デルタが 0.05 増加
セータ日々の時間価値の減少Θ = -$5 → 時間の経過により 1 日あたり $5 の損失
ベガボラティリティ感応度ν = $10 → IV が 1% 上昇した場合、$10 の利益
ロー金利感応度ρ = $2 → 金利が 1% 上昇した場合、$2 の利益
ステップ 5:戦略の損益をシミュレーション

目的: 満期時のさまざまな株価における損益を計算します。

方法:

株価の範囲を生成します(例:現在の株価の ±30%)。

current_price = 180
price_range = np.linspace(current_price * 0.7, current_price * 1.3, 100)

各価格点で損益を計算します。

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_contracts

主な指標:

  • 最大利益:可能な損益の最大値
  • 最大損失:最悪の場合の損益
  • 損益分岐点: 損益が 0 となる株価
  • 利益確率: 利益が出る価格範囲の割合(簡易計算)

出力例:

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)
ステップ 6:損益図を生成(ASCII アート)

株価ごとの損益を視覚的に表現:

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)

出力例:

P/L Diagram: Bull Call Spread $180/$185
------------------------------------------------------------
 +2500 |                               ████████████████████
       |                         ██████
       |                   ██████
       |             ██████
     0 |       ──────
       | ░░░░░░
       |░░░░░░
 -2500 |░░░░░
      |____________________________________________________________
       $126                  $180                   $234
                          Stock Price

Legend: █ Profit  ░ Loss  ── Breakeven  │ Current Price
ステップ 7:戦略に応じた分析

戦略の種類に応じて、個別にガイダンスを提示します。

カバードコール:

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 shares

プロテクティブ・プット:

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 shares

アイアン・コンドル:

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
ステップ 8:決算戦略の分析

決算カレンダーとの連携:

ユーザーが決算戦略について尋ねた場合は、決算日を取得します。

from earnings_calendar import get_next_earnings_date

earnings_date = get_next_earnings_date("AAPL")
days_to_earnings = (earnings_date - today).days

決算前の戦略:

ロング・ストラドル/ストラングル:

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)

ショート・アイアン・コンドル:

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)
ステップ 9:リスク管理のガイダンス

ポジションサイズ:

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 spreads

ポートフォリオのグリークス管理:

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 rising

調整と決済:

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)

出力形式

戦略分析レポートのテンプレート:

# Options Strategy Analysis: [Strategy Name]

**Symbol:** [TICKER]
**Strategy:** [Strategy Type]
**Expiration:** [Date] ([DTE] days)
**Contracts:** [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)

---

## 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)

---

## P/L Diagram

[ASCII art diagram here]

---

## Greeks Analysis

### Position Greeks (1 spread)
- **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%)

### Interpretation
- **Directional Bias:** Slightly bullish (positive delta)
- **Time Decay:** Working against you (negative theta)
- **Volatility:** Benefits from IV increase (positive vega)

---

## Risk Assessment

### Maximum Risk
**Scenario:** Stock falls below $180
**Max Loss:** -$250 (100% of premium paid)
**% of Account:** 0.5% (if $50k account)

### 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

### Profit Taking
- **Target 1:** 50% profit ($125) - Close half
- **Target 2:** 75% profit ($187.50) - Close all

### Stop Loss
- **Trigger:** Stock falls below $177 (-$150 loss)
- **Action:** Close position immediately

### Adjustments
- If stock rallies to $184, consider rolling short call higher
- If stock drops to $179, add second spread at $175/$180

---

## Suitability

### When to Use This Strategy
✅ Moderately bullish on AAPL
✅ Expect upside to $185-$190
✅ Want defined risk
✅ 21-45 DTE timeframe

### 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)

---

## 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.*

ファイル名の命名規則:

options_analysis_[TICKER]_[STRATEGY]_[DATE].md

例:options_analysis_AAPL_BullCallSpread_2025-11-08.md

主な原則

理論価格の限界

ユーザーが知っておくべきこと:

  1. Black-Scholes の前提:

    • ヨーロピアンオプション(早期行使不可)
    • ボラティリティ一定(実際には IV が変化)
    • 取引コストなし
    • 連続取引
  2. 実際と理論:

    • ビッド・アスク・スプレッド: 実際のコストは理論値より高い
    • アメリカンオプション: 早期行使が可能(特に ITM プット)
    • 流動性: 流動性の低いオプションではスプレッドが広い
    • 配当: 配当落ち日は価格に影響する
  3. ベストプラクティス:

    • 教育ツールおよび比較分析として使用する
    • 取引前にブローカーから実際の気配値を取得する
    • 理論価格 ≈ ミッドマーケット価格であることを理解する
    • 手数料とスリッページを考慮する
ボラティリティのガイダンス

ヒストリカル・ボラティリティ vs インプライド・ボラティリティ:

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 priced

IV パーセンタイル:

ユーザーが現在の IV を提供し、当方がパーセンタイルを計算します:

# Fetch 1-year HV data
historical_hvs = calculate_hv_series(prices_1yr, window=30)

# Calculate IV percentile
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"

他のスキルとの統合

決算カレンダー:

  • 決算日を自動的に取得する
  • 決算に特化した戦略を提案する
  • 決算までの日数を計算する(DTE は IV にとって重要)
  • IV クラッシュのリスクについて警告する

テクニカルアナリスト:

  • サポート/レジスタンスをストライク選定に使用する
  • 方向性戦略にはトレンド分析を使用する
  • ストラドル/ストラングルのタイミングにはブレイクアウトの可能性を使用する

米国株分析:

  • 長期戦略(LEAPS)にはファンダメンタル分析を使用する
  • カバードコール/プット分析には配当利回りを使用する
  • 決算狙いには決算の質を使用する

バブル検出器:

  • バブルリスクが高い → 保護的プットに注力する
  • リスクが低い → 強気戦略
  • クリティカルリスク → ロングプレミアムを避ける(シータが不利に働く)

ポートフォリオマネージャー:

  • オプションポジションを株式ポジションと並行して追跡する
  • ポートフォリオ全体のグリークスを集計する
  • 株式ポジションのヘッジ手段としてのオプション

重要な注意点

  • すべての分析は英語
  • 教育重視: 戦略を明確に説明する
  • 理論価格: Black-Scholes による近似
  • ユーザーによる IV 入力: 任意、デフォルトは HV
  • リアルタイムデータ不要: FMP 無料枠で十分
  • 依存関係: Python 3.8+、numpy、scipy、pandas

一般的なユースケース

ユースケース 1: 戦略を学ぶ

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 alternatives

ユースケース 2: 特定の取引を分析する

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 report

ユースケース 3: 決算戦略

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 strategies

ユースケース 4: ポートフォリオのグリークス確認

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

トラブルシューティング

問題: IV が利用できない

  • 解決策: HV を代理として使用し、ユーザーに注記する
  • ユーザーにブローカープラットフォームから IV を提供するよう依頼する

問題: オプション価格がマイナス

  • 解決策: 入力を確認する(ストライクと株価)
  • 深い ITM オプションでは数値的な問題が発生する可能性がある

問題: グリークスが正しくないように見える

  • 解決策: 入力を検証する(T、sigma、r)
  • 年率値と日次値のどちらを使用しているか確認する

問題: 戦略が複雑すぎる

  • 解決策: レッグに分解し、個別に分析する
  • 戦略の詳細についてはリファレンスを参照する

リソース

リファレンス:

  • references/black_scholes_methodology.md - Black-Scholes の公式、グリークス、解釈
  • references/strategies_guide.md - 全 17 以上の戦略の解説(将来)
  • references/greeks_explained.md - グリークスの詳細解説(将来)
  • references/volatility_guide.md - HV と IV、取引すべきタイミング(将来)

スクリプト:

  • scripts/black_scholes.py - 価格計算エンジンとグリークス
  • scripts/strategy_analyzer.py - 戦略のシミュレーション
  • scripts/earnings_strategy.py - 決算に特化した分析

外部リソース:


バージョン: 1.0 最終更新: 2025-11-08 依存関係: Python 3.8+、numpy、scipy、pandas、requests API: FMP API(無料枠で十分)

コメント