spread-analysis
npx machina-cli add skill staskh/trading_skills/spread-analysis --openclawSpread Analysis
Analyze multi-leg option strategies.
Instructions
Note: If
uvis not installed orpyproject.tomlis not found, replaceuv run pythonwithpythonin all commands below.
uv run python scripts/spreads.py SYMBOL --strategy STRATEGY --expiry YYYY-MM-DD [options]
Strategies and Options
Vertical Spread (bull/bear call/put spread):
uv run python scripts/spreads.py AAPL --strategy vertical --expiry 2026-01-16 --type call --long-strike 180 --short-strike 185
Straddle (long call + long put at same strike):
uv run python scripts/spreads.py AAPL --strategy straddle --expiry 2026-01-16 --strike 180
Strangle (long call + long put at different strikes):
uv run python scripts/spreads.py AAPL --strategy strangle --expiry 2026-01-16 --put-strike 175 --call-strike 185
Iron Condor (sell strangle + buy wider strangle):
uv run python scripts/spreads.py AAPL --strategy iron-condor --expiry 2026-01-16 --put-short 175 --put-long 170 --call-short 185 --call-long 190
Output
Returns JSON with:
strategy- Strategy name and legscost- Net debit or creditmax_profit- Maximum potential profitmax_loss- Maximum potential lossbreakeven- Breakeven price(s)probability- Estimated probability of profit (based on IV)
Explain the risk/reward and when this strategy is appropriate.
Dependencies
pandasyfinance
Source
git clone https://github.com/staskh/trading_skills/blob/main/.claude/skills/spread-analysis/SKILL.mdView on GitHub Overview
Spread Analysis evaluates multi-leg option strategies such as vertical spreads, iron condors, straddles, and strangles. It provides a structured output with strategy details, risk/reward, and when to use each approach.
How This Skill Works
Call the Python script with a symbol and strategy parameters (e.g., uv run python scripts/spreads.py SYMBOL --strategy STRATEGY --expiry YYYY-MM-DD [options]). The tool returns a JSON object containing strategy, cost, max_profit, max_loss, breakeven, and probability, calculated from market data (via pandas and yfinance). This mirrors examples like vertical spreads, straddles, strangles, and iron condors described in the SKILL.
When to Use It
- When evaluating a specific spread or multi-leg strategy (vertical spread, iron condor, straddle, strangle) for a given symbol and expiry.
- When comparing risk/reward profiles across different spread types for the same market view.
- When you need a concrete cost, max profit/loss, and breakeven analysis to inform a trade decision.
- When assessing probability of profit based on IV and price data for the chosen legs.
- When you want a ready-to-use JSON output to feed into dashboards or reports.
Quick Start
- Step 1: Run a spread example, e.g., uv run python scripts/spreads.py AAPL --strategy vertical --expiry 2026-01-16 --type call --long-strike 180 --short-strike 185
- Step 2: Review the JSON output for strategy, cost, max_profit, max_loss, breakeven, and probability
- Step 3: Use the risk/reward details to decide if the spread aligns with your market view and risk tolerance
Best Practices
- Define your objective: directional play vs neutral/market-neutral income.
- Verify expiry date, leg strikes, and strategy name before running the script.
- Cross-check cost (net debit/credit) and ensure it aligns with your risk tolerance.
- Review breakeven prices and probability of profit to set realistic expectations.
- Keep dependencies up to date (pandas, yfinance) and handle Python path (uv vs python) as described.
Example Use Cases
- Vertical call spread on AAPL with expiry 2026-01-16, long 180, short 185.
- Vertical put spread to cap downside with a bull/bear setup on SPY.
- Iron Condor on SPX with put and call wings at specified strikes and same expiry.
- Straddle on MSFT entering near earnings when IV is elevated.
- Strangle on NVDA with put and call strikes at different levels to capture a breakout.