Loading...
Loading...
Use when user wants to calculate the annualized return on selling options (puts or calls). Triggers on "计算期权收益", "期权年化", "权利金收益", "option yield", "premium return", or when option trading screenshots are shared with yield analysis intent.
npx skill4agent add longerian/longerian-skills option-yield~/.longerian/scripts/option_yield_calculator.py~/.longerian/~/.longerian/
├── scripts/option_yield_calculator.py # Calculation script
└── data/option-yield/
├── option_input.json # Input (temporary)
└── option_result.json # Output (temporary)Net Capital Occupied = Strike Price - Premium
Annualized Premium Return = (Premium / Net Capital Occupied) × (12 / Remaining Months to Expiration)
Total Annualized Return = Annualized Premium Return + Risk-Free Interest Rate| Parameter | Description | Default Value |
|---|---|---|
| underlying | Underlying asset code (e.g., AAPL, 700) | Required |
| market | Market (us / hk) | Automatically determined based on the underlying asset |
| option_type | Option type (put / call) | put |
| strike | Strike price | Required |
| premium | Premium (per share) | Required |
| months | Remaining months to expiration | Required |
| quantity | Number of contracts | 1 |
| shares_per_contract | Number of shares per contract | 100 for US stocks, need to query for HK stocks |
| Market | Search Keywords | Interest Rate Source |
|---|---|---|
| US | "US 1-year Treasury yield" | US 1-year Treasury yield |
| HK | "HK HIBOR rate" | Hong Kong Interbank Offered Rate |
# Write to ~/.longerian/data/option-yield/option_input.jsonpython3 ~/.longerian/scripts/option_yield_calculator.py# Read from ~/.longerian/data/option-yield/option_result.json📊 Option Premium Annualized Return Calculation
━━━━━━━━━━━━━━━━━━━━━━━
Underlying: AAPL
Market: US Stocks
Option Type: Sell Put
Strike Price: $195.00
Premium: $14.45/share
Expiration Date: 2026-01-16 (7 months remaining)
Quantity: 999 contracts (99,900 shares)
💰 Return Analysis
━━━━━━━━━━━━━━━━━━━━━━━
Net Capital Occupied: $180.55/share
Total Premium Income: $1,443,555.00
Annualized Premium Return Rate: 13.7%
Risk-Free Interest Rate: 4.3% (US 1Y Treasury, 2026-05-01)
Total Annualized Return Rate: 18.0%📊 Option Premium Annualized Return Calculation (Summary)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
┌──────┬────────┬────────┬────────────┬──────────┬───────────────┬──────────┐
│ Optn │ Strike │ Premium │ Expiration │ Remaining│ Net Capital │ Annualized│
│ │ Price │ │ Date │ Months │ Occupied/Share│ Premium │
├──────┼────────┼────────┼────────────┼──────────┼───────────────┼──────────┤
│ #1 │ $27 │ $1.544 │ 2026-09-18│ ~4.6 mths│ $25.456 │ 16.2% │
│ #2 │ $33 │ $1.08 │ 2026-06-18│ ~1.5 mths│ $31.92 │ 27.1% │
│ #3 │ $38 │ $0.975 │ 2026-05-15│ ~0.5 mths│ $37.025 │ 63.4% │
└──────┴────────┴────────┴────────────┴──────────┴───────────────┴──────────┘
Risk-Free Interest Rate: 4.4% (US 1Y Treasury)
💰 Summary Return Analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Premium income per contract (including shares):
#1: $1.544 × 100 shares = $154.40
#2: $1.08 × 100 shares = $108.00
#3: $0.975 × 100 shares = $97.50
Total: $359.90
Total Net Capital Occupied: $25.456×100 + $31.92×100 + $37.025×100 = $9,440.10
Comprehensive Annualized Premium Return Rate: $359.90 / $9,440.10 × (12 / Average Months) = ~34%
Total Annualized Return Including Risk-Free Rate: ~38%| Scenario | Handling |
|---|---|
| Premium >= Strike Price | Error: Unreasonable parameters |
| Remaining months <= 0 | Error: Expired |
| Failed to search for risk-free interest rate | Ask user to input manually |
| Risk-free interest rate data exceeds 7 days | Warn user that data may be outdated |
| Screenshot cannot be recognized | Ask user to provide text information |
| Market cannot be automatically determined | Ask user whether it is US stocks or HK stocks |
| Failed to query shares per contract in HK market | Ask user how many shares correspond to each contract |