Skip to main content
ClaudeWave
Skill12k repo starsupdated today

options-payoff

The options-payoff skill calculates profit and loss diagrams for single and multi-leg option strategies using Black-Scholes pricing and Greeks analysis. Use it for backtesting and research scenarios involving vertical spreads, straddles, butterflies, condors, and other complex option portfolios to visualize payoff curves, identify breakeven points, and evaluate strategy performance across different underlying price movements and implied volatility levels.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading /tmp/options-payoff && cp -r /tmp/options-payoff/agent/src/skills/options-payoff ~/.claude/skills/options-payoff
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Options Payoff — Option P&L Analysis Methodology

## Overview

This skill is designed for option strategy analysis scenarios within the Vibe-Trading quantitative framework, covering:
- P&L curve generation for single-leg and multi-leg option portfolios
- Black-Scholes pricing and Greeks calculation
- Implied volatility inversion
- Strategy selection decision support

**Constraint**: For research and backtesting only. Do not output live trading instructions, in line with the project's guardrails.

---

## 1. Supported Strategy Types

### 1.1 Single-Leg Strategies

| Strategy | Bias | Premium | Max Profit | Max Loss |
|------|------|--------|----------|----------|
| Long Call | Bullish | Paid | Unlimited | Premium |
| Long Put | Bearish | Paid | Strike - premium | Premium |
| Short Call | Neutral / mildly bearish | Received | Premium | Unlimited |
| Short Put | Neutral / mildly bullish | Received | Premium | Strike - premium |

### 1.2 Vertical Spreads

| Strategy | Structure | Market View | Net Premium |
|------|------|----------|----------|
| Bull Call Spread | Long Call (lower K) + Short Call (higher K) | Moderately bullish | Net debit |
| Bear Put Spread | Long Put (higher K) + Short Put (lower K) | Moderately bearish | Net debit |
| Bull Put Spread | Short Put (higher K) + Long Put (lower K) | Moderately bullish | Net credit |
| Bear Call Spread | Short Call (lower K) + Long Call (higher K) | Moderately bearish | Net credit |

### 1.3 Straddles / Strangles (Volatility Strategies)

| Strategy | Structure | Market View |
|------|------|----------|
| Long Straddle | Long Call (ATM) + Long Put (ATM) | Large move up or down, low volatility |
| Short Straddle | Short Call (ATM) + Short Put (ATM) | Range-bound market, high volatility |
| Long Strangle | Long Call (OTM) + Long Put (OTM) | Large move, lower cost than a straddle |
| Short Strangle | Short Call (OTM) + Short Put (OTM) | Tight range, collect two-sided premium |

### 1.4 Butterflies / Iron Butterflies

| Strategy | Structure | Feature |
|------|------|------|
| Long Butterfly (Call) | Long Call (K1) + 2× Short Call (K2) + Long Call (K3) | Low-cost bet that the underlying expires near K2 |
| Long Butterfly (Put) | Long Put (K3) + 2× Short Put (K2) + Long Put (K1) | Same logic, built with puts |
| Iron Butterfly | Short Call (K2) + Short Put (K2) + Long Call (K3) + Long Put (K1) | Net credit, max profit at K2 |

### 1.5 Condors / Iron Condors

| Strategy | Structure | Feature |
|------|------|------|
| Long Condor (Call) | Long Call (K1) + Short Call (K2) + Short Call (K3) + Long Call (K4) | Bet that the underlying stays between K2 and K3 |
| Iron Condor | Short Put (K2) + Long Put (K1) + Short Call (K3) + Long Call (K4) | Most common neutral strategy with capped risk on both sides |

Here K1 < K2 < K3 < K4, and K2 / K3 are usually OTM.

### 1.6 Calendar Spreads (Time Spreads)

| Strategy | Structure | Market View |
|------|------|----------|
| Calendar Spread | Short near-month Call/Put (K) + Long far-month Call/Put (K) | Short-term range-bound market + rising forward volatility |
| Diagonal Spread | Short near-month Call/Put (K1) + Long far-month Call/Put (K2) | Calendar spread with mild directional bias |

Calendar spreads profit because near-month Theta decay is faster than far-month Theta decay.

### 1.7 Ratio Spreads

| Strategy | Structure | Feature |
|------|------|------|
| Ratio Call Spread | Long 1× Call (K1) + Short N× Call (K2), N>1 | Limited upside profit, losses if the upside move becomes extreme |
| Ratio Put Spread | Long 1× Put (K2) + Short N× Put (K1) | Limited downside profit, losses if the downside move becomes extreme |
| Call Back Spread | Short 1× Call (K1) + Long N× Call (K2), N>1 | Profits from extreme upside, loses on a modest rally |
| Put Back Spread | Short 1× Put (K2) + Long N× Put (K1), N>1 | Profits from extreme downside, loses on a mild decline |

### 1.8 Protective / Hedging Strategies

| Strategy | Structure | Use Case |
|------|------|------|
| Covered Call | Long underlying + Short Call (K) | Generate income on an existing position, give up gains above K |
| Protective Put | Long underlying + Long Put (K) | Downside protection on an existing position, pay an insurance premium |
| Collar | Long underlying + Long Put (K1) + Short Call (K2) | Lock the position into a zero-cost / low-cost range |

---

## 2. Black-Scholes Pricing Model

### 2.1 Core Assumptions

- The underlying price follows geometric Brownian motion (lognormal distribution)
- Risk-free rate `r` is constant
- Volatility `σ` is constant (historical or implied)
- No dividends, or adjust with a continuous dividend yield `q`
- European options only (exercise at expiration)

### 2.2 Full Formula

```
S  = current underlying price
K  = strike price
T  = time to expiration (years)
r  = risk-free rate (annualized continuous compounding)
q  = continuous dividend yield (commonly used for China A-share / index options)
σ  = annualized volatility
N  = standard normal CDF

d1 = [ln(S/K) + (r - q + σ²/2) × T] / (σ × √T)
d2 = d1 - σ × √T

Call = S × e^(-qT) × N(d1) - K × e^(-rT) × N(d2)
Put  = K × e^(-rT) × N(-d2) - S × e^(-qT) × N(-d1)
```

### 2.3 Put-Call Parity

```
Call - Put = S × e^(-qT) - K × e^(-rT)
```

Use this to verify pricing consistency and detect arbitrage. When dividends exist, replace `S` with `S × e^(-qT)`.

### 2.4 Greeks Calculation

#### Delta (Price Sensitivity)
```
Delta(Call) = e^(-qT) × N(d1)
Delta(Put)  = e^(-qT) × (N(d1) - 1)
```
- Range: Call [0, 1], Put [-1, 0]
- ATM ≈ ±0.5, deep ITM → ±1, deep OTM → 0

#### Gamma (Rate of Change of Delta)
```
Gamma = e^(-qT) × N'(d1) / (S × σ × √T)

N'(x) = (1/√(2π)) × e^(-x²/2)  [standard normal PDF]
```
- Calls and puts have the same Gamma
- Gamma is highest near ATM and explodes as expiration approaches

#### Theta (Time Decay, per day)
```
Theta(Call) = [-S × e^(-qT) × N'(d1) × σ / (2√T)
               - r × K × e^(-rT) × N(d2)
               + q × S × e^(-qT) × N(d1)] / 365
vibe-tradingSkill

Professional finance research toolkit — backtesting (7 engines + benchmark comparison panel), factor analysis, Alpha Zoo (452 pre-built alphas across qlib158/alpha101/gtja191/academic), options pricing, 77 finance skills, 29 multi-agent swarm teams, Trade Journal analyzer, and Shadow Account (extract → backtest → render) across 7 data sources (tushare, yfinance, okx, akshare, mootdx, ccxt, futu).

adr-hshareSkill

ADR/H-share/A-share cross-listing premium analysis — track pricing gaps between US-listed ADRs, HK-listed H-shares, and A-shares for arbitrage signals, dual-listing valuation, and delisting risk assessment.

akshareSkill

AKShare financial data aggregator (18k+ stars). Free, no API key. Covers A-shares, US, HK, futures, macro, forex. Primary fallback for tushare and yfinance.

alpha-zooSkill

Browse and bench the bundled alpha zoos — prebuilt cross-sectional factor libraries (Kakushadze 101, GTJA 191, Qlib 158, Fama-French / Carhart). Use when the user asks "which alphas exist", wants metadata on a named alpha, or wants to run IC/IR on a whole zoo over a universe.

ashare-pre-st-filterSkill

A 股 ST/*ST 风险预测框架 — 基于最新中报/三季报或业绩预告/快报,预测下一财年是否会因营收、利润、净资产、分红不达标而被风险警示,并将新浪监管处罚记录作为独立证据面纳入风险等级。仅适用于 A 股,不预测财务造假。

asset-allocationSkill

Asset allocation theory and optimizer usage — MPT / Black-Litterman / risk budgeting / all-weather strategy, including guides for 4 optimizers and rebalancing rules.

backtest-diagnoseSkill

Diagnose failed or underperforming backtests, locate the root cause, and fix the issue

behavioral-financeSkill

Behavioral finance applications: theories of overreaction and underreaction, behavioral explanations for momentum and reversal, investor sentiment cycles, cognitive-bias checklists, and debiasing quantitative strategies.