Install
$ agentstack add skill-xonevn-ai-xone-trading-skills-options-strategy-advisor ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Options 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
Prerequisites
Required:
- Python 3.8+ with
numpy,scipy,requests
Optional:
- FMP API key (for real-time stock prices and historical volatility)
- Set via
FMP_API_KEYenvironment variable or--api-keyargument - Without API key: Use manual inputs for stock price and volatility
Installation:
pip install numpy scipy requests
Quick Start Examples:
# 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
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"
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)
Protection Strategies
- Protective Put - Own stock, buy put (insurance, limited downside)
- Collar - Own stock, sell call + buy put (limited upside/downside)
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)
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)
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)
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)
Analysis Workflow
Step 1: Gather Input Data
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)
Step 2: Calculate Historical Volatility (if IV not provided)
Objective: Estimate volatility from historical price movements.
Method:
# 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
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.0parameter
Step 3: Price Options Using 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 distribution
Adjustments:
- Subtract present value of dividends from S for calls
- American options: Use approximation or note "European pricing, may undervalue American options"
Python Implementation:
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
Output for Each Option Leg:
- Theoretical price
- Note: "Market price may differ due to bid-ask spread and American vs European pricing"
Step 4: Calculate Greeks
The Greeks measure option price sensitivity to various factors:
Delta (Δ): Change in option price per $1 change in stock price
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
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)
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
Vega (ν): Change in option price per 1% change in volatility
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
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:
# 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)
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% |
Step 5: Simulate Strategy P/L
Objective: Calculate profit/loss at various stock prices at expiration.
Method:
Generate stock price range (e.g., ±30% from current price):
current_price = 180
price_range = np.linspace(current_price * 0.7, current_price * 1.3, 100)
For each price point, calculate P/L:
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
Key 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)
Step 6: Generate P/L Diagram (ASCII Art)
Visual representation of P/L across stock prices:
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) 0:
char = '█' # Profit
elif pnl $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
Protective 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 shares
Iron 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
Step 8: Earnings Strategy Analysis
Integration with Earnings Calendar:
When user asks about earnings strategies, fetch earnings date:
from earnings_calendar import get_next_earnings_date
earnings_date = get_next_earnings_date("AAPL")
days_to_earnings = (earnings_date - today).days
Pre-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 (10% move)
Exit Plan:
- Close next day if IV crushed (capture profit early)
- Use stop loss if one side tested (-2x credit)
Step 9: Risk Management Guidance
Position Sizing:
Account Size: $50,000
Risk Tolerance: 2% per trade = $1,000 ma
…
## Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- **Author:** [xonevn-ai](https://github.com/xonevn-ai)
- **Source:** [xonevn-ai/xone-trading-skills](https://github.com/xonevn-ai/xone-trading-skills)
- **License:** MIT
- **Homepage:** https://xone.vn
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.