{
  "schemaVersion": "1.0",
  "item": {
    "slug": "options-strategy-advisor",
    "name": "Options Strategy Advisor",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/Veeramanikandanr48/options-strategy-advisor",
    "canonicalUrl": "https://clawhub.ai/Veeramanikandanr48/options-strategy-advisor",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/options-strategy-advisor",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=options-strategy-advisor",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "scripts/black_scholes.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/options-strategy-advisor"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/options-strategy-advisor",
    "agentPageUrl": "https://openagent3.xyz/skills/options-strategy-advisor/agent",
    "manifestUrl": "https://openagent3.xyz/skills/options-strategy-advisor/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/options-strategy-advisor/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Overview",
        "body": "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.\n\nCore Capabilities:\n\nBlack-Scholes Pricing: Theoretical option prices and Greeks calculation\nStrategy Simulation: P/L analysis for major options strategies\nEarnings Strategies: Pre-earnings volatility plays integrated with Earnings Calendar\nRisk Management: Position sizing, Greeks exposure, max loss/profit analysis\nEducational Focus: Detailed explanations of strategies and risk metrics\n\nData Sources:\n\nFMP API: Stock prices, historical volatility, dividends, earnings dates\nUser Input: Implied volatility (IV), risk-free rate\nTheoretical Models: Black-Scholes for pricing and Greeks"
      },
      {
        "title": "When to Use This Skill",
        "body": "Use this skill when:\n\nUser asks about options strategies (\"What's a covered call?\", \"How does an iron condor work?\")\nUser wants to simulate strategy P/L (\"What's my max profit on a bull call spread?\")\nUser needs Greeks analysis (\"What's my delta exposure?\")\nUser asks about earnings strategies (\"Should I buy a straddle before earnings?\")\nUser wants to compare strategies (\"Covered call vs protective put?\")\nUser needs position sizing guidance (\"How many contracts should I trade?\")\nUser asks about volatility (\"Is IV high right now?\")\n\nExample requests:\n\n\"Analyze a covered call on AAPL\"\n\"What's the P/L on a $100/$105 bull call spread on MSFT?\"\n\"Should I trade a straddle before NVDA earnings?\"\n\"Calculate Greeks for my iron condor position\"\n\"Compare protective put vs covered call for downside protection\""
      },
      {
        "title": "Income Strategies",
        "body": "Covered Call - Own stock, sell call (generate income, cap upside)\nCash-Secured Put - Sell put with cash backing (collect premium, willing to buy stock)\nPoor Man's Covered Call - LEAPS call + short near-term call (capital efficient)"
      },
      {
        "title": "Protection Strategies",
        "body": "Protective Put - Own stock, buy put (insurance, limited downside)\nCollar - Own stock, sell call + buy put (limited upside/downside)"
      },
      {
        "title": "Directional Strategies",
        "body": "Bull Call Spread - Buy lower strike call, sell higher strike call (limited risk/reward bullish)\nBull Put Spread - Sell higher strike put, buy lower strike put (credit spread, bullish)\nBear Call Spread - Sell lower strike call, buy higher strike call (credit spread, bearish)\nBear Put Spread - Buy higher strike put, sell lower strike put (limited risk/reward bearish)"
      },
      {
        "title": "Volatility Strategies",
        "body": "Long Straddle - Buy ATM call + ATM put (profit from big move either direction)\nLong Strangle - Buy OTM call + OTM put (cheaper than straddle, bigger move needed)\nShort Straddle - Sell ATM call + ATM put (profit from no movement, unlimited risk)\nShort Strangle - Sell OTM call + OTM put (profit from no movement, wider range)"
      },
      {
        "title": "Range-Bound Strategies",
        "body": "Iron Condor - Bull put spread + bear call spread (profit from range-bound movement)\nIron Butterfly - Sell ATM straddle, buy OTM strangle (profit from tight range)"
      },
      {
        "title": "Advanced Strategies",
        "body": "Calendar Spread - Sell near-term option, buy longer-term option (profit from time decay)\nDiagonal Spread - Calendar spread with different strikes (directional + time decay)\nRatio Spread - Unbalanced spread (more contracts on one leg)"
      },
      {
        "title": "Step 1: Gather Input Data",
        "body": "Required from User:\n\nTicker symbol\nStrategy type\nStrike prices\nExpiration date(s)\nPosition size (number of contracts)\n\nOptional from User:\n\nImplied Volatility (IV) - if not provided, use Historical Volatility (HV)\nRisk-free rate - default to current 3-month T-bill rate (~5.3% as of 2025)\n\nFetched from FMP API:\n\nCurrent stock price\nHistorical prices (for HV calculation)\nDividend yield\nUpcoming earnings date (for earnings strategies)\n\nExample User Input:\n\nTicker: AAPL\nStrategy: Bull Call Spread\nLong Strike: $180\nShort Strike: $185\nExpiration: 30 days\nContracts: 10\nIV: 25% (or use HV if not provided)"
      },
      {
        "title": "Step 2: Calculate Historical Volatility (if IV not provided)",
        "body": "Objective: Estimate volatility from historical price movements.\n\nMethod:\n\n# Fetch 90 days of price data\nprices = get_historical_prices(\"AAPL\", days=90)\n\n# Calculate daily returns\nreturns = np.log(prices / prices.shift(1))\n\n# Annualized volatility\nHV = returns.std() * np.sqrt(252)  # 252 trading days\n\nOutput:\n\nHistorical Volatility (annualized percentage)\nNote to user: \"HV = 24.5%, consider using current market IV for more accuracy\"\n\nUser Can Override:\n\nProvide IV from broker platform (ThinkorSwim, TastyTrade, etc.)\nScript accepts --iv 28.0 parameter"
      },
      {
        "title": "Step 3: Price Options Using Black-Scholes",
        "body": "Black-Scholes Model:\n\nFor European-style options:\n\nCall Price = S * N(d1) - K * e^(-r*T) * N(d2)\nPut Price = K * e^(-r*T) * N(-d2) - S * N(-d1)\n\nWhere:\nd1 = [ln(S/K) + (r + σ²/2) * T] / (σ * √T)\nd2 = d1 - σ * √T\n\nS = Current stock price\nK = Strike price\nr = Risk-free rate\nT = Time to expiration (years)\nσ = Volatility (IV or HV)\nN() = Cumulative standard normal distribution\n\nAdjustments:\n\nSubtract present value of dividends from S for calls\nAmerican options: Use approximation or note \"European pricing, may undervalue American options\"\n\nPython Implementation:\n\nfrom scipy.stats import norm\nimport numpy as np\n\ndef black_scholes_call(S, K, T, r, sigma, q=0):\n    \"\"\"\n    S: Stock price\n    K: Strike price\n    T: Time to expiration (years)\n    r: Risk-free rate\n    sigma: Volatility\n    q: Dividend yield\n    \"\"\"\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    d2 = d1 - sigma*np.sqrt(T)\n\n    call_price = S*np.exp(-q*T)*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\n    return call_price\n\ndef black_scholes_put(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    d2 = d1 - sigma*np.sqrt(T)\n\n    put_price = K*np.exp(-r*T)*norm.cdf(-d2) - S*np.exp(-q*T)*norm.cdf(-d1)\n    return put_price\n\nOutput for Each Option Leg:\n\nTheoretical price\nNote: \"Market price may differ due to bid-ask spread and American vs European pricing\""
      },
      {
        "title": "Step 4: Calculate Greeks",
        "body": "The Greeks measure option price sensitivity to various factors:\n\nDelta (Δ): Change in option price per $1 change in stock price\n\ndef delta_call(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    return np.exp(-q*T) * norm.cdf(d1)\n\ndef delta_put(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    return np.exp(-q*T) * (norm.cdf(d1) - 1)\n\nGamma (Γ): Change in delta per $1 change in stock price\n\ndef gamma(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    return np.exp(-q*T) * norm.pdf(d1) / (S * sigma * np.sqrt(T))\n\nTheta (Θ): Change in option price per day (time decay)\n\ndef theta_call(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    d2 = d1 - sigma*np.sqrt(T)\n\n    theta = (-S*norm.pdf(d1)*sigma*np.exp(-q*T)/(2*np.sqrt(T))\n             - r*K*np.exp(-r*T)*norm.cdf(d2)\n             + q*S*norm.cdf(d1)*np.exp(-q*T))\n\n    return theta / 365  # Per day\n\nVega (ν): Change in option price per 1% change in volatility\n\ndef vega(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    return S * np.exp(-q*T) * norm.pdf(d1) * np.sqrt(T) / 100  # Per 1%\n\nRho (ρ): Change in option price per 1% change in interest rate\n\ndef rho_call(S, K, T, r, sigma, q=0):\n    d2 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T)) - sigma*np.sqrt(T)\n    return K * T * np.exp(-r*T) * norm.cdf(d2) / 100  # Per 1%\n\nPosition Greeks:\n\nFor a strategy with multiple legs, sum Greeks across all legs:\n\n# Example: Bull Call Spread\n# Long 1x $180 call\n# Short 1x $185 call\n\ndelta_position = (1 * delta_long) + (-1 * delta_short)\ngamma_position = (1 * gamma_long) + (-1 * gamma_short)\ntheta_position = (1 * theta_long) + (-1 * theta_short)\nvega_position = (1 * vega_long) + (-1 * vega_short)\n\nGreeks Interpretation:\n\nGreekMeaningExampleDeltaDirectional exposureΔ = 0.50 → $50 profit if stock +$1GammaDelta accelerationΓ = 0.05 → Delta increases by 0.05 if stock +$1ThetaDaily time decayΘ = -$5 → Lose $5/day from time passingVegaVolatility sensitivityν = $10 → Gain $10 if IV increases 1%RhoInterest rate sensitivityρ = $2 → Gain $2 if rates increase 1%"
      },
      {
        "title": "Step 5: Simulate Strategy P/L",
        "body": "Objective: Calculate profit/loss at various stock prices at expiration.\n\nMethod:\n\nGenerate stock price range (e.g., ±30% from current price):\n\ncurrent_price = 180\nprice_range = np.linspace(current_price * 0.7, current_price * 1.3, 100)\n\nFor each price point, calculate P/L:\n\ndef calculate_pnl(strategy, stock_price_at_expiration):\n    pnl = 0\n\n    for leg in strategy.legs:\n        if leg.type == 'call':\n            intrinsic_value = max(0, stock_price_at_expiration - leg.strike)\n        else:  # put\n            intrinsic_value = max(0, leg.strike - stock_price_at_expiration)\n\n        if leg.position == 'long':\n            pnl += (intrinsic_value - leg.premium_paid) * 100  # Per contract\n        else:  # short\n            pnl += (leg.premium_received - intrinsic_value) * 100\n\n    return pnl * num_contracts\n\nKey Metrics:\n\nMax Profit: Highest possible P/L\nMax Loss: Worst possible P/L\nBreakeven Point(s): Stock price(s) where P/L = 0\nProfit Probability: Percentage of price range that's profitable (simplified)\n\nExample Output:\n\nBull Call Spread: $180/$185 on AAPL (30 DTE, 10 contracts)\n\nCurrent Price: $180.00\nNet Debit: $2.50 per spread ($2,500 total)\n\nMax Profit: $2,500 (at $185+)\nMax Loss: -$2,500 (at $180-)\nBreakeven: $182.50\nRisk/Reward: 1:1\n\nProbability Profit: ~55% (if stock stays above $182.50)"
      },
      {
        "title": "Step 6: Generate P/L Diagram (ASCII Art)",
        "body": "Visual representation of P/L across stock prices:\n\ndef generate_pnl_diagram(price_range, pnl_values, current_price, width=60, height=15):\n    \"\"\"Generate ASCII P/L diagram\"\"\"\n\n    # Normalize to chart dimensions\n    max_pnl = max(pnl_values)\n    min_pnl = min(pnl_values)\n\n    lines = []\n    lines.append(f\"\\nP/L Diagram: {strategy_name}\")\n    lines.append(\"-\" * width)\n\n    # Y-axis levels\n    levels = np.linspace(max_pnl, min_pnl, height)\n\n    for level in levels:\n        if abs(level) < (max_pnl - min_pnl) * 0.05:\n            label = f\"    0 |\"  # Zero line\n        else:\n            label = f\"{level:6.0f} |\"\n\n        row = label\n        for i in range(width - len(label)):\n            idx = int(i / (width - len(label)) * len(price_range))\n            pnl = pnl_values[idx]\n            price = price_range[idx]\n\n            # Determine character\n            if abs(pnl - level) < (max_pnl - min_pnl) / height:\n                if pnl > 0:\n                    char = '█'  # Profit\n                elif pnl < 0:\n                    char = '░'  # Loss\n                else:\n                    char = '─'  # Breakeven\n            elif abs(level) < (max_pnl - min_pnl) * 0.05:\n                char = '─'  # Zero line\n            elif abs(price - current_price) < (price_range[-1] - price_range[0]) * 0.02:\n                char = '│'  # Current price line\n            else:\n                char = ' '\n\n            row += char\n\n        lines.append(row)\n\n    lines.append(\" \" * 6 + \"|\" + \"-\" * (width - 6))\n    lines.append(\" \" * 6 + f\"${price_range[0]:.0f}\" + \" \" * (width - 20) + f\"${price_range[-1]:.0f}\")\n    lines.append(\" \" * (width // 2 - 5) + \"Stock Price\")\n\n    return \"\\n\".join(lines)\n\nExample Output:\n\nP/L Diagram: Bull Call Spread $180/$185\n------------------------------------------------------------\n +2500 |                               ████████████████████\n       |                         ██████\n       |                   ██████\n       |             ██████\n     0 |       ──────\n       | ░░░░░░\n       |░░░░░░\n -2500 |░░░░░\n      |____________________________________________________________\n       $126                  $180                   $234\n                          Stock Price\n\nLegend: █ Profit  ░ Loss  ── Breakeven  │ Current Price"
      },
      {
        "title": "Step 7: Strategy-Specific Analysis",
        "body": "Provide tailored guidance based on strategy type:\n\nCovered Call:\n\nIncome Strategy: Generate premium while capping upside\n\nSetup:\n- Own 100 shares of AAPL @ $180\n- Sell 1x $185 call (30 DTE) for $3.50\n\nMax Profit: $850 (Stock at $185+ = $5 stock gain + $3.50 premium)\nMax Loss: Unlimited downside (stock ownership)\nBreakeven: $176.50 (Cost basis - premium received)\n\nGreeks:\n- Delta: -0.30 (reduces stock delta from 1.00 to 0.70)\n- Theta: +$8/day (time decay benefit)\n\nAssignment Risk: If AAPL > $185 at expiration, shares called away\n\nWhen to Use:\n- Neutral to slightly bullish\n- Want income in sideways market\n- Willing to sell stock at $185\n\nExit Plan:\n- Buy back call if stock rallies strongly (preserve upside)\n- Let expire if stock stays below $185\n- Roll to next month if want to keep shares\n\nProtective Put:\n\nInsurance Strategy: Limit downside while keeping upside\n\nSetup:\n- Own 100 shares of AAPL @ $180\n- Buy 1x $175 put (30 DTE) for $2.00\n\nMax Profit: Unlimited (stock can rise infinitely)\nMax Loss: -$7 per share = ($5 stock loss + $2 premium)\nBreakeven: $182 (Cost basis + premium paid)\n\nGreeks:\n- Delta: +0.80 (stock delta 1.00 - put delta 0.20)\n- Theta: -$6/day (time decay cost)\n\nProtection: Guaranteed to sell at $175, no matter how far stock falls\n\nWhen to Use:\n- Own stock, worried about short-term drop\n- Earnings coming up, want protection\n- Alternative to stop-loss (can't be stopped out)\n\nCost: \"Insurance premium\" - typically 1-3% of stock value\n\nExit Plan:\n- Let expire worthless if stock rises (cost of insurance)\n- Exercise put if stock falls below $175\n- Sell put if stock drops but want to keep shares\n\nIron Condor:\n\nRange-Bound Strategy: Profit from low volatility\n\nSetup (example on AAPL @ $180):\n- Sell $175 put for $1.50\n- Buy $170 put for $0.50\n- Sell $185 call for $1.50\n- Buy $190 call for $0.50\n\nNet Credit: $2.00 ($200 per iron condor)\n\nMax Profit: $200 (if stock stays between $175-$185)\nMax Loss: $300 (if stock moves outside $170-$190)\nBreakevens: $173 and $187\nProfit Range: $175 to $185 (58% probability)\n\nGreeks:\n- Delta: ~0 (market neutral)\n- Theta: +$15/day (time decay benefit)\n- Vega: -$25 (short volatility)\n\nWhen to Use:\n- Expect low volatility, range-bound movement\n- After big move, think consolidation\n- High IV environment (sell expensive options)\n\nRisk: Unlimited if one side tested\n- Use stop loss at 2x credit received (exit at -$400)\n\nAdjustments:\n- If tested on one side, roll that side out in time\n- Close early at 50% max profit to reduce tail risk"
      },
      {
        "title": "Step 8: Earnings Strategy Analysis",
        "body": "Integration with Earnings Calendar:\n\nWhen user asks about earnings strategies, fetch earnings date:\n\nfrom earnings_calendar import get_next_earnings_date\n\nearnings_date = get_next_earnings_date(\"AAPL\")\ndays_to_earnings = (earnings_date - today).days\n\nPre-Earnings Strategies:\n\nLong Straddle/Strangle:\n\nSetup (AAPL @ $180, earnings in 7 days):\n- Buy $180 call for $5.00\n- Buy $180 put for $4.50\n- Total Cost: $9.50\n\nThesis: Expect big move (>5%) but unsure of direction\n\nBreakevens: $170.50 and $189.50\nProfit if: Stock moves >$9.50 in either direction\n\nGreeks:\n- Delta: ~0 (neutral)\n- Vega: +$50 (long volatility)\n- Theta: -$25/day (time decay hurts)\n\nIV Crush Risk: ⚠️ CRITICAL\n- Pre-earnings IV: 40% (elevated)\n- Post-earnings IV: 25% (typical)\n- IV drop: -15 points = -$750 loss even if stock doesn't move!\n\nAnalysis:\n- Implied Move: √(DTE/365) × IV × Stock Price\n  = √(7/365) × 0.40 × 180 = ±$10.50\n- Breakeven Move Needed: ±$9.50\n- Probability Profit: ~30-40% (implied move > breakeven move)\n\nRecommendation:\n✅ Consider if you expect >10% move (larger than implied)\n❌ Avoid if expect normal ~5% earnings move (IV crush will hurt)\n\nAlternative: Buy further OTM strikes to reduce cost\n- $175/$185 strangle cost $4.00 (need >$8 move, but cheaper)\n\nShort Iron Condor:\n\nSetup (AAPL @ $180, earnings in 7 days):\n- Sell $170/$175 put spread for $2.00\n- Sell $185/$190 call spread for $2.00\n- Net Credit: $4.00\n\nThesis: Expect stock to stay range-bound ($175-$185)\n\nProfit Zone: $175 to $185\nMax Profit: $400\nMax Loss: $100\n\nIV Crush Benefit: ✅\n- Short high IV before earnings\n- IV drops after earnings → profit on vega\n- Even if stock moves slightly, IV drop helps\n\nGreeks:\n- Delta: ~0 (market neutral)\n- Vega: -$40 (short volatility - good here!)\n- Theta: +$20/day\n\nRecommendation:\n✅ Good if expect normal earnings reaction (<8% move)\n✅ Benefit from IV crush regardless of direction\n⚠️ Risk if stock gaps outside range (>10% move)\n\nExit Plan:\n- Close next day if IV crushed (capture profit early)\n- Use stop loss if one side tested (-2x credit)"
      },
      {
        "title": "Step 9: Risk Management Guidance",
        "body": "Position Sizing:\n\nAccount Size: $50,000\nRisk Tolerance: 2% per trade = $1,000 max risk\n\nIron Condor Example:\n- Max loss per spread: $300\n- Max contracts: $1,000 / $300 = 3 contracts\n- Actual position: 3 iron condors\n\nBull Call Spread Example:\n- Debit paid: $2.50 per spread\n- Max contracts: $1,000 / $250 = 4 contracts\n- Actual position: 4 spreads\n\nPortfolio Greeks Management:\n\nPortfolio Guidelines:\n- Delta: -10 to +10 (mostly neutral)\n- Theta: Positive preferred (seller advantage)\n- Vega: Monitor if >$500 (IV risk)\n\nCurrent Portfolio:\n- Delta: +5 (slightly bullish)\n- Theta: +$150/day (collecting $150 daily)\n- Vega: -$300 (short volatility)\n\nInterpretation:\n✅ Neutral delta (safe)\n✅ Positive theta (time working for you)\n⚠️ Short vega: If IV spikes, lose $300 per 1% IV increase\n→ Reduce short premium positions if VIX rising\n\nAdjustments and Exits:\n\nExit Rules by Strategy:\n\nCovered Call:\n- Profit: 50-75% of max profit\n- Loss: Stock drops >5%, buy back call to preserve upside\n- Time: 7-10 DTE, roll to avoid assignment\n\nSpreads:\n- Profit: 50% of max profit (close early, reduce tail risk)\n- Loss: 2x debit paid (cut losses early)\n- Time: 21 DTE, close or roll (avoid gamma risk)\n\nIron Condor:\n- Profit: 50% of credit (close early common)\n- Loss: One side tested, 2x credit lost\n- Adjustment: Roll tested side out in time\n\nStraddle/Strangle:\n- Profit: Stock moved >breakeven, close immediately\n- Loss: Theta eating position, stock not moving\n- Time: Day after earnings (if earnings play)"
      },
      {
        "title": "Output Format",
        "body": "Strategy Analysis Report Template:\n\n# Options Strategy Analysis: [Strategy Name]\n\n**Symbol:** [TICKER]\n**Strategy:** [Strategy Type]\n**Expiration:** [Date] ([DTE] days)\n**Contracts:** [Number]\n\n---\n\n## Strategy Setup\n\n### Leg Details\n| Leg | Type | Strike | Price | Position | Quantity |\n|-----|------|--------|-------|----------|----------|\n| 1 | Call | $180 | $5.00 | Long | 1 |\n| 2 | Call | $185 | $2.50 | Short | 1 |\n\n**Net Debit/Credit:** $2.50 debit ($250 total for 1 spread)\n\n---\n\n## Profit/Loss Analysis\n\n**Max Profit:** $250 (at $185+)\n**Max Loss:** -$250 (at $180-)\n**Breakeven:** $182.50\n**Risk/Reward Ratio:** 1:1\n\n**Probability Analysis:**\n- Probability of Profit: ~55% (stock above $182.50)\n- Expected Value: $25 (simplified)\n\n---\n\n## P/L Diagram\n\n[ASCII art diagram here]\n\n---\n\n## Greeks Analysis\n\n### Position Greeks (1 spread)\n- **Delta:** +0.20 (gains $20 if stock +$1)\n- **Gamma:** +0.03 (delta increases by 0.03 if stock +$1)\n- **Theta:** -$5/day (loses $5 per day from time decay)\n- **Vega:** +$8 (gains $8 if IV increases 1%)\n\n### Interpretation\n- **Directional Bias:** Slightly bullish (positive delta)\n- **Time Decay:** Working against you (negative theta)\n- **Volatility:** Benefits from IV increase (positive vega)\n\n---\n\n## Risk Assessment\n\n### Maximum Risk\n**Scenario:** Stock falls below $180\n**Max Loss:** -$250 (100% of premium paid)\n**% of Account:** 0.5% (if $50k account)\n\n### Assignment Risk\n**Early Assignment:** Low (calls have time value)\n**At Expiration:** Manage positions if in-the-money\n\n---\n\n## Trade Management\n\n### Entry\n✅ Enter if: [Conditions]\n- Stock price $178-$182\n- IV below 30%\n- >21 DTE\n\n### Profit Taking\n- **Target 1:** 50% profit ($125) - Close half\n- **Target 2:** 75% profit ($187.50) - Close all\n\n### Stop Loss\n- **Trigger:** Stock falls below $177 (-$150 loss)\n- **Action:** Close position immediately\n\n### Adjustments\n- If stock rallies to $184, consider rolling short call higher\n- If stock drops to $179, add second spread at $175/$180\n\n---\n\n## Suitability\n\n### When to Use This Strategy\n✅ Moderately bullish on AAPL\n✅ Expect upside to $185-$190\n✅ Want defined risk\n✅ 21-45 DTE timeframe\n\n### When to Avoid\n❌ Very bullish (buy stock or long call instead)\n❌ High IV environment (wait for IV to drop)\n❌ Earnings in <7 days (IV crush risk)\n\n---\n\n## Alternatives Comparison\n\n| Strategy | Max Profit | Max Loss | Complexity | When Better |\n|----------|-----------|----------|------------|-------------|\n| Bull Call Spread | $250 | -$250 | Medium | Moderately bullish |\n| Long Call | Unlimited | -$500 | Low | Very bullish |\n| Covered Call | $850 | Unlimited | Medium | Own stock already |\n| Bull Put Spread | $300 | -$200 | Medium | Want credit spread |\n\n**Recommendation:** Bull call spread is good balance of risk/reward for moderate bullish thesis.\n\n---\n\n*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.*\n\nFile Naming Convention:\n\noptions_analysis_[TICKER]_[STRATEGY]_[DATE].md\n\nExample: options_analysis_AAPL_BullCallSpread_2025-11-08.md"
      },
      {
        "title": "Theoretical Pricing Limitations",
        "body": "What Users Should Know:\n\nBlack-Scholes Assumptions:\n\nEuropean-style options (can't exercise early)\nConstant volatility (IV changes in reality)\nNo transaction costs\nContinuous trading\n\n\n\nReal vs Theoretical:\n\nBid-ask spread: Actual cost higher than theoretical\nAmerican options: Can be exercised early (especially ITM puts)\nLiquidity: Wide markets on illiquid options\nDividends: Ex-dividend dates affect pricing\n\n\n\nBest Practices:\n\nUse as educational tool and comparative analysis\nGet real quotes from broker before trading\nUnderstand theoretical price ≈ mid-market price\nAccount for commissions and slippage"
      },
      {
        "title": "Volatility Guidance",
        "body": "Historical vs Implied Volatility:\n\nHistorical Volatility (HV): What happened\n- Calculated from past price movements\n- Objective, based on data\n- Available for free (FMP API)\n\nImplied Volatility (IV): What market expects\n- Derived from option prices\n- Subjective, based on supply/demand\n- Requires live options data (user provides)\n\nComparison:\n- IV > HV: Options expensive (consider selling)\n- IV < HV: Options cheap (consider buying)\n- IV = HV: Fairly priced\n\nIV Percentile:\n\nUser provides current IV, we calculate percentile:\n\n# Fetch 1-year HV data\nhistorical_hvs = calculate_hv_series(prices_1yr, window=30)\n\n# Calculate IV percentile\niv_percentile = percentileofscore(historical_hvs, current_iv)\n\nif iv_percentile > 75:\n    guidance = \"High IV - consider selling premium (credit spreads, iron condors)\"\nelif iv_percentile < 25:\n    guidance = \"Low IV - consider buying options (long calls/puts, debit spreads)\"\nelse:\n    guidance = \"Normal IV - any strategy appropriate\""
      },
      {
        "title": "Integration with Other Skills",
        "body": "Earnings Calendar:\n\nFetch earnings dates automatically\nSuggest earnings-specific strategies\nCalculate days to earnings (DTE critical for IV)\nWarn about IV crush risk\n\nTechnical Analyst:\n\nUse support/resistance for strike selection\nTrend analysis for directional strategies\nBreakout potential for straddle/strangle timing\n\nUS Stock Analysis:\n\nFundamental analysis for longer-term strategies (LEAPS)\nDividend yield for covered call/put analysis\nEarnings quality for earnings plays\n\nBubble Detector:\n\nHigh bubble risk → focus on protective puts\nLow risk → bullish strategies\nCritical risk → avoid long premium (theta hurts)\n\nPortfolio Manager:\n\nTrack options positions alongside stock positions\nAggregate Greeks across portfolio\nOptions as hedging tool for stock positions"
      },
      {
        "title": "Important Notes",
        "body": "All analysis in English\nEducational focus: Strategies explained clearly\nTheoretical pricing: Black-Scholes approximation\nUser IV input: Optional, defaults to HV\nNo real-time data required: FMP Free tier sufficient\nDependencies: Python 3.8+, numpy, scipy, pandas"
      },
      {
        "title": "Common Use Cases",
        "body": "Use Case 1: Learn Strategy\n\nUser: \"Explain a covered call\"\n\nWorkflow:\n1. Load strategy reference (references/strategies_guide.md)\n2. Explain concept, risk/reward, when to use\n3. Simulate example on AAPL\n4. Show P/L diagram\n5. Compare to alternatives\n\nUse Case 2: Analyze Specific Trade\n\nUser: \"Analyze $180/$185 bull call spread on AAPL, 30 days\"\n\nWorkflow:\n1. Fetch AAPL price from FMP\n2. Calculate HV or ask user for IV\n3. Price both options (Black-Scholes)\n4. Calculate Greeks\n5. Simulate P/L\n6. Generate analysis report\n\nUse Case 3: Earnings Strategy\n\nUser: \"Should I trade options before NVDA earnings?\"\n\nWorkflow:\n1. Fetch NVDA earnings date (Earnings Calendar)\n2. Calculate days to earnings\n3. Estimate IV percentile (if user provides IV)\n4. Suggest straddle/strangle vs iron condor\n5. Warn about IV crush\n6. Simulate both strategies\n\nUse Case 4: Portfolio Greeks Check\n\nUser: \"What are my total portfolio Greeks?\"\n\nWorkflow:\n1. User provides current positions\n2. Calculate Greeks for each position\n3. Sum Greeks across portfolio\n4. Assess overall exposure\n5. Suggest adjustments if needed"
      },
      {
        "title": "Troubleshooting",
        "body": "Problem: IV not available\n\nSolution: Use HV as proxy, note to user\nAsk user to provide IV from broker platform\n\nProblem: Negative option price\n\nSolution: Check inputs (strike vs stock price)\nDeep ITM options may have numerical issues\n\nProblem: Greeks seem wrong\n\nSolution: Verify inputs (T, sigma, r)\nCheck if using annual vs daily values\n\nProblem: Strategy too complex\n\nSolution: Break into legs, analyze separately\nRefer to references for strategy details"
      },
      {
        "title": "Resources",
        "body": "References:\n\nreferences/strategies_guide.md - All 17+ strategies explained\nreferences/greeks_explained.md - Greeks deep dive\nreferences/volatility_guide.md - HV vs IV, when to trade\n\nScripts:\n\nscripts/black_scholes.py - Pricing engine and Greeks\nscripts/strategy_analyzer.py - Strategy simulation\nscripts/earnings_strategy.py - Earnings-specific analysis\n\nExternal Resources:\n\nOptions Playbook: https://www.optionsplaybook.com/\nCBOE Education: https://www.cboe.com/education/\nBlack-Scholes Calculator: Various online tools for verification\n\nVersion: 1.0\nLast Updated: 2025-11-08\nDependencies: Python 3.8+, numpy, scipy, pandas, requests\nAPI: FMP API (Free tier sufficient)"
      }
    ],
    "body": "Options Strategy Advisor\nOverview\n\nThis 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.\n\nCore Capabilities:\n\nBlack-Scholes Pricing: Theoretical option prices and Greeks calculation\nStrategy Simulation: P/L analysis for major options strategies\nEarnings Strategies: Pre-earnings volatility plays integrated with Earnings Calendar\nRisk Management: Position sizing, Greeks exposure, max loss/profit analysis\nEducational Focus: Detailed explanations of strategies and risk metrics\n\nData Sources:\n\nFMP API: Stock prices, historical volatility, dividends, earnings dates\nUser Input: Implied volatility (IV), risk-free rate\nTheoretical Models: Black-Scholes for pricing and Greeks\nWhen to Use This Skill\n\nUse this skill when:\n\nUser asks about options strategies (\"What's a covered call?\", \"How does an iron condor work?\")\nUser wants to simulate strategy P/L (\"What's my max profit on a bull call spread?\")\nUser needs Greeks analysis (\"What's my delta exposure?\")\nUser asks about earnings strategies (\"Should I buy a straddle before earnings?\")\nUser wants to compare strategies (\"Covered call vs protective put?\")\nUser needs position sizing guidance (\"How many contracts should I trade?\")\nUser asks about volatility (\"Is IV high right now?\")\n\nExample requests:\n\n\"Analyze a covered call on AAPL\"\n\"What's the P/L on a $100/$105 bull call spread on MSFT?\"\n\"Should I trade a straddle before NVDA earnings?\"\n\"Calculate Greeks for my iron condor position\"\n\"Compare protective put vs covered call for downside protection\"\nSupported Strategies\nIncome Strategies\nCovered Call - Own stock, sell call (generate income, cap upside)\nCash-Secured Put - Sell put with cash backing (collect premium, willing to buy stock)\nPoor Man's Covered Call - LEAPS call + short near-term call (capital efficient)\nProtection Strategies\nProtective Put - Own stock, buy put (insurance, limited downside)\nCollar - Own stock, sell call + buy put (limited upside/downside)\nDirectional Strategies\nBull Call Spread - Buy lower strike call, sell higher strike call (limited risk/reward bullish)\nBull Put Spread - Sell higher strike put, buy lower strike put (credit spread, bullish)\nBear Call Spread - Sell lower strike call, buy higher strike call (credit spread, bearish)\nBear Put Spread - Buy higher strike put, sell lower strike put (limited risk/reward bearish)\nVolatility Strategies\nLong Straddle - Buy ATM call + ATM put (profit from big move either direction)\nLong Strangle - Buy OTM call + OTM put (cheaper than straddle, bigger move needed)\nShort Straddle - Sell ATM call + ATM put (profit from no movement, unlimited risk)\nShort Strangle - Sell OTM call + OTM put (profit from no movement, wider range)\nRange-Bound Strategies\nIron Condor - Bull put spread + bear call spread (profit from range-bound movement)\nIron Butterfly - Sell ATM straddle, buy OTM strangle (profit from tight range)\nAdvanced Strategies\nCalendar Spread - Sell near-term option, buy longer-term option (profit from time decay)\nDiagonal Spread - Calendar spread with different strikes (directional + time decay)\nRatio Spread - Unbalanced spread (more contracts on one leg)\nAnalysis Workflow\nStep 1: Gather Input Data\n\nRequired from User:\n\nTicker symbol\nStrategy type\nStrike prices\nExpiration date(s)\nPosition size (number of contracts)\n\nOptional from User:\n\nImplied Volatility (IV) - if not provided, use Historical Volatility (HV)\nRisk-free rate - default to current 3-month T-bill rate (~5.3% as of 2025)\n\nFetched from FMP API:\n\nCurrent stock price\nHistorical prices (for HV calculation)\nDividend yield\nUpcoming earnings date (for earnings strategies)\n\nExample User Input:\n\nTicker: AAPL\nStrategy: Bull Call Spread\nLong Strike: $180\nShort Strike: $185\nExpiration: 30 days\nContracts: 10\nIV: 25% (or use HV if not provided)\n\nStep 2: Calculate Historical Volatility (if IV not provided)\n\nObjective: Estimate volatility from historical price movements.\n\nMethod:\n\n# Fetch 90 days of price data\nprices = get_historical_prices(\"AAPL\", days=90)\n\n# Calculate daily returns\nreturns = np.log(prices / prices.shift(1))\n\n# Annualized volatility\nHV = returns.std() * np.sqrt(252)  # 252 trading days\n\n\nOutput:\n\nHistorical Volatility (annualized percentage)\nNote to user: \"HV = 24.5%, consider using current market IV for more accuracy\"\n\nUser Can Override:\n\nProvide IV from broker platform (ThinkorSwim, TastyTrade, etc.)\nScript accepts --iv 28.0 parameter\nStep 3: Price Options Using Black-Scholes\n\nBlack-Scholes Model:\n\nFor European-style options:\n\nCall Price = S * N(d1) - K * e^(-r*T) * N(d2)\nPut Price = K * e^(-r*T) * N(-d2) - S * N(-d1)\n\nWhere:\nd1 = [ln(S/K) + (r + σ²/2) * T] / (σ * √T)\nd2 = d1 - σ * √T\n\nS = Current stock price\nK = Strike price\nr = Risk-free rate\nT = Time to expiration (years)\nσ = Volatility (IV or HV)\nN() = Cumulative standard normal distribution\n\n\nAdjustments:\n\nSubtract present value of dividends from S for calls\nAmerican options: Use approximation or note \"European pricing, may undervalue American options\"\n\nPython Implementation:\n\nfrom scipy.stats import norm\nimport numpy as np\n\ndef black_scholes_call(S, K, T, r, sigma, q=0):\n    \"\"\"\n    S: Stock price\n    K: Strike price\n    T: Time to expiration (years)\n    r: Risk-free rate\n    sigma: Volatility\n    q: Dividend yield\n    \"\"\"\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    d2 = d1 - sigma*np.sqrt(T)\n\n    call_price = S*np.exp(-q*T)*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\n    return call_price\n\ndef black_scholes_put(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    d2 = d1 - sigma*np.sqrt(T)\n\n    put_price = K*np.exp(-r*T)*norm.cdf(-d2) - S*np.exp(-q*T)*norm.cdf(-d1)\n    return put_price\n\n\nOutput for Each Option Leg:\n\nTheoretical price\nNote: \"Market price may differ due to bid-ask spread and American vs European pricing\"\nStep 4: Calculate Greeks\n\nThe Greeks measure option price sensitivity to various factors:\n\nDelta (Δ): Change in option price per $1 change in stock price\n\ndef delta_call(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    return np.exp(-q*T) * norm.cdf(d1)\n\ndef delta_put(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    return np.exp(-q*T) * (norm.cdf(d1) - 1)\n\n\nGamma (Γ): Change in delta per $1 change in stock price\n\ndef gamma(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    return np.exp(-q*T) * norm.pdf(d1) / (S * sigma * np.sqrt(T))\n\n\nTheta (Θ): Change in option price per day (time decay)\n\ndef theta_call(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    d2 = d1 - sigma*np.sqrt(T)\n\n    theta = (-S*norm.pdf(d1)*sigma*np.exp(-q*T)/(2*np.sqrt(T))\n             - r*K*np.exp(-r*T)*norm.cdf(d2)\n             + q*S*norm.cdf(d1)*np.exp(-q*T))\n\n    return theta / 365  # Per day\n\n\nVega (ν): Change in option price per 1% change in volatility\n\ndef vega(S, K, T, r, sigma, q=0):\n    d1 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\n    return S * np.exp(-q*T) * norm.pdf(d1) * np.sqrt(T) / 100  # Per 1%\n\n\nRho (ρ): Change in option price per 1% change in interest rate\n\ndef rho_call(S, K, T, r, sigma, q=0):\n    d2 = (np.log(S/K) + (r - q + 0.5*sigma**2)*T) / (sigma*np.sqrt(T)) - sigma*np.sqrt(T)\n    return K * T * np.exp(-r*T) * norm.cdf(d2) / 100  # Per 1%\n\n\nPosition Greeks:\n\nFor a strategy with multiple legs, sum Greeks across all legs:\n\n# Example: Bull Call Spread\n# Long 1x $180 call\n# Short 1x $185 call\n\ndelta_position = (1 * delta_long) + (-1 * delta_short)\ngamma_position = (1 * gamma_long) + (-1 * gamma_short)\ntheta_position = (1 * theta_long) + (-1 * theta_short)\nvega_position = (1 * vega_long) + (-1 * vega_short)\n\n\nGreeks Interpretation:\n\nGreek\tMeaning\tExample\nDelta\tDirectional exposure\tΔ = 0.50 → $50 profit if stock +$1\nGamma\tDelta acceleration\tΓ = 0.05 → Delta increases by 0.05 if stock +$1\nTheta\tDaily time decay\tΘ = -$5 → Lose $5/day from time passing\nVega\tVolatility sensitivity\tν = $10 → Gain $10 if IV increases 1%\nRho\tInterest rate sensitivity\tρ = $2 → Gain $2 if rates increase 1%\nStep 5: Simulate Strategy P/L\n\nObjective: Calculate profit/loss at various stock prices at expiration.\n\nMethod:\n\nGenerate stock price range (e.g., ±30% from current price):\n\ncurrent_price = 180\nprice_range = np.linspace(current_price * 0.7, current_price * 1.3, 100)\n\n\nFor each price point, calculate P/L:\n\ndef calculate_pnl(strategy, stock_price_at_expiration):\n    pnl = 0\n\n    for leg in strategy.legs:\n        if leg.type == 'call':\n            intrinsic_value = max(0, stock_price_at_expiration - leg.strike)\n        else:  # put\n            intrinsic_value = max(0, leg.strike - stock_price_at_expiration)\n\n        if leg.position == 'long':\n            pnl += (intrinsic_value - leg.premium_paid) * 100  # Per contract\n        else:  # short\n            pnl += (leg.premium_received - intrinsic_value) * 100\n\n    return pnl * num_contracts\n\n\nKey Metrics:\n\nMax Profit: Highest possible P/L\nMax Loss: Worst possible P/L\nBreakeven Point(s): Stock price(s) where P/L = 0\nProfit Probability: Percentage of price range that's profitable (simplified)\n\nExample Output:\n\nBull Call Spread: $180/$185 on AAPL (30 DTE, 10 contracts)\n\nCurrent Price: $180.00\nNet Debit: $2.50 per spread ($2,500 total)\n\nMax Profit: $2,500 (at $185+)\nMax Loss: -$2,500 (at $180-)\nBreakeven: $182.50\nRisk/Reward: 1:1\n\nProbability Profit: ~55% (if stock stays above $182.50)\n\nStep 6: Generate P/L Diagram (ASCII Art)\n\nVisual representation of P/L across stock prices:\n\ndef generate_pnl_diagram(price_range, pnl_values, current_price, width=60, height=15):\n    \"\"\"Generate ASCII P/L diagram\"\"\"\n\n    # Normalize to chart dimensions\n    max_pnl = max(pnl_values)\n    min_pnl = min(pnl_values)\n\n    lines = []\n    lines.append(f\"\\nP/L Diagram: {strategy_name}\")\n    lines.append(\"-\" * width)\n\n    # Y-axis levels\n    levels = np.linspace(max_pnl, min_pnl, height)\n\n    for level in levels:\n        if abs(level) < (max_pnl - min_pnl) * 0.05:\n            label = f\"    0 |\"  # Zero line\n        else:\n            label = f\"{level:6.0f} |\"\n\n        row = label\n        for i in range(width - len(label)):\n            idx = int(i / (width - len(label)) * len(price_range))\n            pnl = pnl_values[idx]\n            price = price_range[idx]\n\n            # Determine character\n            if abs(pnl - level) < (max_pnl - min_pnl) / height:\n                if pnl > 0:\n                    char = '█'  # Profit\n                elif pnl < 0:\n                    char = '░'  # Loss\n                else:\n                    char = '─'  # Breakeven\n            elif abs(level) < (max_pnl - min_pnl) * 0.05:\n                char = '─'  # Zero line\n            elif abs(price - current_price) < (price_range[-1] - price_range[0]) * 0.02:\n                char = '│'  # Current price line\n            else:\n                char = ' '\n\n            row += char\n\n        lines.append(row)\n\n    lines.append(\" \" * 6 + \"|\" + \"-\" * (width - 6))\n    lines.append(\" \" * 6 + f\"${price_range[0]:.0f}\" + \" \" * (width - 20) + f\"${price_range[-1]:.0f}\")\n    lines.append(\" \" * (width // 2 - 5) + \"Stock Price\")\n\n    return \"\\n\".join(lines)\n\n\nExample Output:\n\nP/L Diagram: Bull Call Spread $180/$185\n------------------------------------------------------------\n +2500 |                               ████████████████████\n       |                         ██████\n       |                   ██████\n       |             ██████\n     0 |       ──────\n       | ░░░░░░\n       |░░░░░░\n -2500 |░░░░░\n      |____________________________________________________________\n       $126                  $180                   $234\n                          Stock Price\n\nLegend: █ Profit  ░ Loss  ── Breakeven  │ Current Price\n\nStep 7: Strategy-Specific Analysis\n\nProvide tailored guidance based on strategy type:\n\nCovered Call:\n\nIncome Strategy: Generate premium while capping upside\n\nSetup:\n- Own 100 shares of AAPL @ $180\n- Sell 1x $185 call (30 DTE) for $3.50\n\nMax Profit: $850 (Stock at $185+ = $5 stock gain + $3.50 premium)\nMax Loss: Unlimited downside (stock ownership)\nBreakeven: $176.50 (Cost basis - premium received)\n\nGreeks:\n- Delta: -0.30 (reduces stock delta from 1.00 to 0.70)\n- Theta: +$8/day (time decay benefit)\n\nAssignment Risk: If AAPL > $185 at expiration, shares called away\n\nWhen to Use:\n- Neutral to slightly bullish\n- Want income in sideways market\n- Willing to sell stock at $185\n\nExit Plan:\n- Buy back call if stock rallies strongly (preserve upside)\n- Let expire if stock stays below $185\n- Roll to next month if want to keep shares\n\n\nProtective Put:\n\nInsurance Strategy: Limit downside while keeping upside\n\nSetup:\n- Own 100 shares of AAPL @ $180\n- Buy 1x $175 put (30 DTE) for $2.00\n\nMax Profit: Unlimited (stock can rise infinitely)\nMax Loss: -$7 per share = ($5 stock loss + $2 premium)\nBreakeven: $182 (Cost basis + premium paid)\n\nGreeks:\n- Delta: +0.80 (stock delta 1.00 - put delta 0.20)\n- Theta: -$6/day (time decay cost)\n\nProtection: Guaranteed to sell at $175, no matter how far stock falls\n\nWhen to Use:\n- Own stock, worried about short-term drop\n- Earnings coming up, want protection\n- Alternative to stop-loss (can't be stopped out)\n\nCost: \"Insurance premium\" - typically 1-3% of stock value\n\nExit Plan:\n- Let expire worthless if stock rises (cost of insurance)\n- Exercise put if stock falls below $175\n- Sell put if stock drops but want to keep shares\n\n\nIron Condor:\n\nRange-Bound Strategy: Profit from low volatility\n\nSetup (example on AAPL @ $180):\n- Sell $175 put for $1.50\n- Buy $170 put for $0.50\n- Sell $185 call for $1.50\n- Buy $190 call for $0.50\n\nNet Credit: $2.00 ($200 per iron condor)\n\nMax Profit: $200 (if stock stays between $175-$185)\nMax Loss: $300 (if stock moves outside $170-$190)\nBreakevens: $173 and $187\nProfit Range: $175 to $185 (58% probability)\n\nGreeks:\n- Delta: ~0 (market neutral)\n- Theta: +$15/day (time decay benefit)\n- Vega: -$25 (short volatility)\n\nWhen to Use:\n- Expect low volatility, range-bound movement\n- After big move, think consolidation\n- High IV environment (sell expensive options)\n\nRisk: Unlimited if one side tested\n- Use stop loss at 2x credit received (exit at -$400)\n\nAdjustments:\n- If tested on one side, roll that side out in time\n- Close early at 50% max profit to reduce tail risk\n\nStep 8: Earnings Strategy Analysis\n\nIntegration with Earnings Calendar:\n\nWhen user asks about earnings strategies, fetch earnings date:\n\nfrom earnings_calendar import get_next_earnings_date\n\nearnings_date = get_next_earnings_date(\"AAPL\")\ndays_to_earnings = (earnings_date - today).days\n\n\nPre-Earnings Strategies:\n\nLong Straddle/Strangle:\n\nSetup (AAPL @ $180, earnings in 7 days):\n- Buy $180 call for $5.00\n- Buy $180 put for $4.50\n- Total Cost: $9.50\n\nThesis: Expect big move (>5%) but unsure of direction\n\nBreakevens: $170.50 and $189.50\nProfit if: Stock moves >$9.50 in either direction\n\nGreeks:\n- Delta: ~0 (neutral)\n- Vega: +$50 (long volatility)\n- Theta: -$25/day (time decay hurts)\n\nIV Crush Risk: ⚠️ CRITICAL\n- Pre-earnings IV: 40% (elevated)\n- Post-earnings IV: 25% (typical)\n- IV drop: -15 points = -$750 loss even if stock doesn't move!\n\nAnalysis:\n- Implied Move: √(DTE/365) × IV × Stock Price\n  = √(7/365) × 0.40 × 180 = ±$10.50\n- Breakeven Move Needed: ±$9.50\n- Probability Profit: ~30-40% (implied move > breakeven move)\n\nRecommendation:\n✅ Consider if you expect >10% move (larger than implied)\n❌ Avoid if expect normal ~5% earnings move (IV crush will hurt)\n\nAlternative: Buy further OTM strikes to reduce cost\n- $175/$185 strangle cost $4.00 (need >$8 move, but cheaper)\n\n\nShort Iron Condor:\n\nSetup (AAPL @ $180, earnings in 7 days):\n- Sell $170/$175 put spread for $2.00\n- Sell $185/$190 call spread for $2.00\n- Net Credit: $4.00\n\nThesis: Expect stock to stay range-bound ($175-$185)\n\nProfit Zone: $175 to $185\nMax Profit: $400\nMax Loss: $100\n\nIV Crush Benefit: ✅\n- Short high IV before earnings\n- IV drops after earnings → profit on vega\n- Even if stock moves slightly, IV drop helps\n\nGreeks:\n- Delta: ~0 (market neutral)\n- Vega: -$40 (short volatility - good here!)\n- Theta: +$20/day\n\nRecommendation:\n✅ Good if expect normal earnings reaction (<8% move)\n✅ Benefit from IV crush regardless of direction\n⚠️ Risk if stock gaps outside range (>10% move)\n\nExit Plan:\n- Close next day if IV crushed (capture profit early)\n- Use stop loss if one side tested (-2x credit)\n\nStep 9: Risk Management Guidance\n\nPosition Sizing:\n\nAccount Size: $50,000\nRisk Tolerance: 2% per trade = $1,000 max risk\n\nIron Condor Example:\n- Max loss per spread: $300\n- Max contracts: $1,000 / $300 = 3 contracts\n- Actual position: 3 iron condors\n\nBull Call Spread Example:\n- Debit paid: $2.50 per spread\n- Max contracts: $1,000 / $250 = 4 contracts\n- Actual position: 4 spreads\n\n\nPortfolio Greeks Management:\n\nPortfolio Guidelines:\n- Delta: -10 to +10 (mostly neutral)\n- Theta: Positive preferred (seller advantage)\n- Vega: Monitor if >$500 (IV risk)\n\nCurrent Portfolio:\n- Delta: +5 (slightly bullish)\n- Theta: +$150/day (collecting $150 daily)\n- Vega: -$300 (short volatility)\n\nInterpretation:\n✅ Neutral delta (safe)\n✅ Positive theta (time working for you)\n⚠️ Short vega: If IV spikes, lose $300 per 1% IV increase\n→ Reduce short premium positions if VIX rising\n\n\nAdjustments and Exits:\n\nExit Rules by Strategy:\n\nCovered Call:\n- Profit: 50-75% of max profit\n- Loss: Stock drops >5%, buy back call to preserve upside\n- Time: 7-10 DTE, roll to avoid assignment\n\nSpreads:\n- Profit: 50% of max profit (close early, reduce tail risk)\n- Loss: 2x debit paid (cut losses early)\n- Time: 21 DTE, close or roll (avoid gamma risk)\n\nIron Condor:\n- Profit: 50% of credit (close early common)\n- Loss: One side tested, 2x credit lost\n- Adjustment: Roll tested side out in time\n\nStraddle/Strangle:\n- Profit: Stock moved >breakeven, close immediately\n- Loss: Theta eating position, stock not moving\n- Time: Day after earnings (if earnings play)\n\nOutput Format\n\nStrategy Analysis Report Template:\n\n# Options Strategy Analysis: [Strategy Name]\n\n**Symbol:** [TICKER]\n**Strategy:** [Strategy Type]\n**Expiration:** [Date] ([DTE] days)\n**Contracts:** [Number]\n\n---\n\n## Strategy Setup\n\n### Leg Details\n| Leg | Type | Strike | Price | Position | Quantity |\n|-----|------|--------|-------|----------|----------|\n| 1 | Call | $180 | $5.00 | Long | 1 |\n| 2 | Call | $185 | $2.50 | Short | 1 |\n\n**Net Debit/Credit:** $2.50 debit ($250 total for 1 spread)\n\n---\n\n## Profit/Loss Analysis\n\n**Max Profit:** $250 (at $185+)\n**Max Loss:** -$250 (at $180-)\n**Breakeven:** $182.50\n**Risk/Reward Ratio:** 1:1\n\n**Probability Analysis:**\n- Probability of Profit: ~55% (stock above $182.50)\n- Expected Value: $25 (simplified)\n\n---\n\n## P/L Diagram\n\n[ASCII art diagram here]\n\n---\n\n## Greeks Analysis\n\n### Position Greeks (1 spread)\n- **Delta:** +0.20 (gains $20 if stock +$1)\n- **Gamma:** +0.03 (delta increases by 0.03 if stock +$1)\n- **Theta:** -$5/day (loses $5 per day from time decay)\n- **Vega:** +$8 (gains $8 if IV increases 1%)\n\n### Interpretation\n- **Directional Bias:** Slightly bullish (positive delta)\n- **Time Decay:** Working against you (negative theta)\n- **Volatility:** Benefits from IV increase (positive vega)\n\n---\n\n## Risk Assessment\n\n### Maximum Risk\n**Scenario:** Stock falls below $180\n**Max Loss:** -$250 (100% of premium paid)\n**% of Account:** 0.5% (if $50k account)\n\n### Assignment Risk\n**Early Assignment:** Low (calls have time value)\n**At Expiration:** Manage positions if in-the-money\n\n---\n\n## Trade Management\n\n### Entry\n✅ Enter if: [Conditions]\n- Stock price $178-$182\n- IV below 30%\n- >21 DTE\n\n### Profit Taking\n- **Target 1:** 50% profit ($125) - Close half\n- **Target 2:** 75% profit ($187.50) - Close all\n\n### Stop Loss\n- **Trigger:** Stock falls below $177 (-$150 loss)\n- **Action:** Close position immediately\n\n### Adjustments\n- If stock rallies to $184, consider rolling short call higher\n- If stock drops to $179, add second spread at $175/$180\n\n---\n\n## Suitability\n\n### When to Use This Strategy\n✅ Moderately bullish on AAPL\n✅ Expect upside to $185-$190\n✅ Want defined risk\n✅ 21-45 DTE timeframe\n\n### When to Avoid\n❌ Very bullish (buy stock or long call instead)\n❌ High IV environment (wait for IV to drop)\n❌ Earnings in <7 days (IV crush risk)\n\n---\n\n## Alternatives Comparison\n\n| Strategy | Max Profit | Max Loss | Complexity | When Better |\n|----------|-----------|----------|------------|-------------|\n| Bull Call Spread | $250 | -$250 | Medium | Moderately bullish |\n| Long Call | Unlimited | -$500 | Low | Very bullish |\n| Covered Call | $850 | Unlimited | Medium | Own stock already |\n| Bull Put Spread | $300 | -$200 | Medium | Want credit spread |\n\n**Recommendation:** Bull call spread is good balance of risk/reward for moderate bullish thesis.\n\n---\n\n*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.*\n\n\nFile Naming Convention:\n\noptions_analysis_[TICKER]_[STRATEGY]_[DATE].md\n\n\nExample: options_analysis_AAPL_BullCallSpread_2025-11-08.md\n\nKey Principles\nTheoretical Pricing Limitations\n\nWhat Users Should Know:\n\nBlack-Scholes Assumptions:\n\nEuropean-style options (can't exercise early)\nConstant volatility (IV changes in reality)\nNo transaction costs\nContinuous trading\n\nReal vs Theoretical:\n\nBid-ask spread: Actual cost higher than theoretical\nAmerican options: Can be exercised early (especially ITM puts)\nLiquidity: Wide markets on illiquid options\nDividends: Ex-dividend dates affect pricing\n\nBest Practices:\n\nUse as educational tool and comparative analysis\nGet real quotes from broker before trading\nUnderstand theoretical price ≈ mid-market price\nAccount for commissions and slippage\nVolatility Guidance\n\nHistorical vs Implied Volatility:\n\nHistorical Volatility (HV): What happened\n- Calculated from past price movements\n- Objective, based on data\n- Available for free (FMP API)\n\nImplied Volatility (IV): What market expects\n- Derived from option prices\n- Subjective, based on supply/demand\n- Requires live options data (user provides)\n\nComparison:\n- IV > HV: Options expensive (consider selling)\n- IV < HV: Options cheap (consider buying)\n- IV = HV: Fairly priced\n\n\nIV Percentile:\n\nUser provides current IV, we calculate percentile:\n\n# Fetch 1-year HV data\nhistorical_hvs = calculate_hv_series(prices_1yr, window=30)\n\n# Calculate IV percentile\niv_percentile = percentileofscore(historical_hvs, current_iv)\n\nif iv_percentile > 75:\n    guidance = \"High IV - consider selling premium (credit spreads, iron condors)\"\nelif iv_percentile < 25:\n    guidance = \"Low IV - consider buying options (long calls/puts, debit spreads)\"\nelse:\n    guidance = \"Normal IV - any strategy appropriate\"\n\nIntegration with Other Skills\n\nEarnings Calendar:\n\nFetch earnings dates automatically\nSuggest earnings-specific strategies\nCalculate days to earnings (DTE critical for IV)\nWarn about IV crush risk\n\nTechnical Analyst:\n\nUse support/resistance for strike selection\nTrend analysis for directional strategies\nBreakout potential for straddle/strangle timing\n\nUS Stock Analysis:\n\nFundamental analysis for longer-term strategies (LEAPS)\nDividend yield for covered call/put analysis\nEarnings quality for earnings plays\n\nBubble Detector:\n\nHigh bubble risk → focus on protective puts\nLow risk → bullish strategies\nCritical risk → avoid long premium (theta hurts)\n\nPortfolio Manager:\n\nTrack options positions alongside stock positions\nAggregate Greeks across portfolio\nOptions as hedging tool for stock positions\nImportant Notes\nAll analysis in English\nEducational focus: Strategies explained clearly\nTheoretical pricing: Black-Scholes approximation\nUser IV input: Optional, defaults to HV\nNo real-time data required: FMP Free tier sufficient\nDependencies: Python 3.8+, numpy, scipy, pandas\nCommon Use Cases\n\nUse Case 1: Learn Strategy\n\nUser: \"Explain a covered call\"\n\nWorkflow:\n1. Load strategy reference (references/strategies_guide.md)\n2. Explain concept, risk/reward, when to use\n3. Simulate example on AAPL\n4. Show P/L diagram\n5. Compare to alternatives\n\n\nUse Case 2: Analyze Specific Trade\n\nUser: \"Analyze $180/$185 bull call spread on AAPL, 30 days\"\n\nWorkflow:\n1. Fetch AAPL price from FMP\n2. Calculate HV or ask user for IV\n3. Price both options (Black-Scholes)\n4. Calculate Greeks\n5. Simulate P/L\n6. Generate analysis report\n\n\nUse Case 3: Earnings Strategy\n\nUser: \"Should I trade options before NVDA earnings?\"\n\nWorkflow:\n1. Fetch NVDA earnings date (Earnings Calendar)\n2. Calculate days to earnings\n3. Estimate IV percentile (if user provides IV)\n4. Suggest straddle/strangle vs iron condor\n5. Warn about IV crush\n6. Simulate both strategies\n\n\nUse Case 4: Portfolio Greeks Check\n\nUser: \"What are my total portfolio Greeks?\"\n\nWorkflow:\n1. User provides current positions\n2. Calculate Greeks for each position\n3. Sum Greeks across portfolio\n4. Assess overall exposure\n5. Suggest adjustments if needed\n\nTroubleshooting\n\nProblem: IV not available\n\nSolution: Use HV as proxy, note to user\nAsk user to provide IV from broker platform\n\nProblem: Negative option price\n\nSolution: Check inputs (strike vs stock price)\nDeep ITM options may have numerical issues\n\nProblem: Greeks seem wrong\n\nSolution: Verify inputs (T, sigma, r)\nCheck if using annual vs daily values\n\nProblem: Strategy too complex\n\nSolution: Break into legs, analyze separately\nRefer to references for strategy details\nResources\n\nReferences:\n\nreferences/strategies_guide.md - All 17+ strategies explained\nreferences/greeks_explained.md - Greeks deep dive\nreferences/volatility_guide.md - HV vs IV, when to trade\n\nScripts:\n\nscripts/black_scholes.py - Pricing engine and Greeks\nscripts/strategy_analyzer.py - Strategy simulation\nscripts/earnings_strategy.py - Earnings-specific analysis\n\nExternal Resources:\n\nOptions Playbook: https://www.optionsplaybook.com/\nCBOE Education: https://www.cboe.com/education/\nBlack-Scholes Calculator: Various online tools for verification\n\nVersion: 1.0 Last Updated: 2025-11-08 Dependencies: Python 3.8+, numpy, scipy, pandas, requests API: FMP API (Free tier sufficient)"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Veeramanikandanr48/options-strategy-advisor",
    "publisherUrl": "https://clawhub.ai/Veeramanikandanr48/options-strategy-advisor",
    "owner": "Veeramanikandanr48",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/options-strategy-advisor",
    "downloadUrl": "https://openagent3.xyz/downloads/options-strategy-advisor",
    "agentUrl": "https://openagent3.xyz/skills/options-strategy-advisor/agent",
    "manifestUrl": "https://openagent3.xyz/skills/options-strategy-advisor/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/options-strategy-advisor/agent.md"
  }
}