[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75BQPR6M0T2J115BBNWRZ4F":3,"skill-same:01M75BQPR6M0T2J115BBNWRZ4F":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M75BQPR6M0T2J115BBNWRZ4F","options-spread-conviction-engine",null,"Multi-regime options spread analysis engine with quantitative rigor. Features regime detection (VIX-based), GARCH volatility forecasting, drawdown-constrained Kelly position sizing, and walk-forward backtesting. Scores vertical spreads (bull put, bear call, bull call, bear put) and multi-leg strategies (iron condors, butterflies, calendar spreads) using Ichimoku, RSI, MACD, Bollinger Bands, and IV term structure analysis.","javimosch\u002Fopen-claw-skills","javimosch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12900508?v=4","01M6D3F2AS6PV75ET9PZ1QGP8J","Javier Leandro Arancibia","01M75B8NCTAJG9WH5YNZH7C3D8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fadamnaghs\u002Foptions-spread-conviction-engine\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: options-spread-conviction-engine\ndescription: Multi-regime options spread analysis engine with quantitative rigor. Features regime detection (VIX-based), GARCH volatility forecasting, drawdown-constrained Kelly position sizing, and walk-forward backtesting. Scores vertical spreads (bull put, bear call, bull call, bear put) and multi-leg strategies (iron condors, butterflies, calendar spreads) using Ichimoku, RSI, MACD, Bollinger Bands, and IV term structure analysis.\nversion: 2.3.0\nauthor: Leonardo Da Pinchy\nmetadata:\n  openclaw:\n    emoji: 📊\n    requires:\n      bins: [\"python3\"]\n    install:\n      - id: venv-setup\n        kind: exec\n        command: \"cd {baseDir} && python3 scripts\u002Fsetup-venv.sh\"\n        label: \"Setup isolated Python environment with dependencies\"\n---\n\n# Options Spread Conviction Engine\n\n**Multi-regime options spread scoring using technical indicators and IV term structure analysis.**\n\n## Install\n\n```bash\nbrew install jq\nnpm install yahoo-finance2\nsudo ln -s \u002Fopt\u002Fhomebrew\u002Fbin\u002Fyahoo-finance \u002Fusr\u002Flocal\u002Fbin\u002Fyf\n```\n\n## Overview\n\nThis engine analyzes any ticker and scores **seven** options strategies across two categories:\n\n### Vertical Spreads (Directional)\n| Strategy | Type | Philosophy | Ideal Setup |\n|----------|------|------------|-------------|\n| **bull_put** | Credit | Mean Reversion | Bullish trend + oversold dip |\n| **bear_call** | Credit | Mean Reversion | Bearish trend + overbought rip |\n| **bull_call** | Debit | Breakout | Strong bullish momentum |\n| **bear_put** | Debit | Breakout | Strong bearish momentum |\n\n### Multi-Leg Strategies (Non-Directional \u002F Theta)\n| Strategy | Type | Philosophy | Ideal Setup |\n|----------|------|------------|-------------|\n| **iron_condor** | Credit | Premium Selling | IV Rank >70, RSI neutral, range-bound |\n| **butterfly** | Debit | Pinning Play | BB squeeze, RSI center, low ADX |\n| **calendar** | Debit | Theta Harvest | Inverted IV term structure (front > back) |\n\n## Scoring Methodology\n\n### Vertical Spreads\n\nWeights vary by strategy type (Credit = Mean Reversion, Debit = Breakout):\n\n#### Credit Spreads (bull_put, bear_call)\n| Indicator | Weight | Purpose |\n|-----------|--------|---------|\n| Ichimoku Cloud | 25 pts | Trend structure & equilibrium |\n| RSI | 20 pts | Entry timing (mean-reversion) |\n| MACD | 15 pts | Momentum confirmation |\n| Bollinger Bands | 25 pts | Volatility regime |\n| ADX | 15 pts | Trend strength validation |\n\n#### Debit Spreads (bull_call, bear_put)\n| Indicator | Weight | Purpose |\n|-----------|--------|---------|\n| Ichimoku Cloud | 20 pts | Trend confirmation |\n| RSI | 10 pts | Directional momentum |\n| MACD | 30 pts | Breakout acceleration |\n| Bollinger Bands | 25 pts | Bandwidth expansion |\n| ADX | 15 pts | Trend strength validation |\n\n### Multi-Leg Strategies\n\n#### Iron Condor (Credit \u002F Range-Bound)\n| Component | Weight | Rationale |\n|-----------|--------|-----------|\n| IV Rank (BBW %) | 25 pts | Rich premiums to sell |\n| RSI Neutrality | 20 pts | No directional momentum |\n| ADX Range-Bound | 20 pts | Weak trend = range structure |\n| Price Position | 20 pts | Centered in range = safe margins |\n| MACD Neutrality | 15 pts | No acceleration in any direction |\n\n**Triggers:**\n- IV Rank > 70: Premium-rich environment\n- RSI 40-60: Neutral momentum\n- ADX \u003C 25: Weak\u002Fno trend\n- Price near %B center: Max profit zone maximized\n\n**Strike Selection:**\n- SELL put at 1-sigma below price (short put)\n- BUY put at 2-sigma below (long put — wing)\n- SELL call at 1-sigma above price (short call)\n- BUY call at 2-sigma above (long call — wing)\n\n**Output:**\n- All 4 strikes (put_long, put_short, call_short, call_long)\n- Max profit zone (width between short strikes)\n- Wing width\n\n#### Butterfly (Debit \u002F Volatility Compression)\n| Component | Weight | Rationale |\n|-----------|--------|-----------|\n| BB Squeeze | 30 pts | Vol compression = narrow range |\n| RSI Neutrality | 25 pts | Price at equilibrium |\n| ADX Weakness | 20 pts | No directional trend at all |\n| Price Centering | 15 pts | At center of range for max profit |\n| MACD Flatness | 10 pts | No momentum |\n\n**Triggers:**\n- BBW percentile \u003C 25: Squeeze active\n- RSI 45-55: Dead-center (tighter than condor)\n- ADX \u003C 20: Very weak trend\n- MACD histogram near zero\n- Price at %B = 0.50\n\n**Strike Selection:**\n- BUY 1 call at strike below center (lower wing)\n- SELL 2 calls at center strike (body)\n- BUY 1 call at strike above center (upper wing)\n\n**Output:**\n- 3 strikes (lower_long, middle_short, upper_long)\n- Max profit price (= middle strike)\n- Profit zone (approximate breakevens)\n\n#### Calendar Spread (Debit \u002F Theta Harvesting)\n| Component | Weight | Rationale |\n|-----------|--------|-----------|\n| IV Term Structure | 30 pts | Front IV > Back IV = theta edge |\n| Price Stability | 20 pts | Price stays near strike |\n| RSI Neutrality | 20 pts | Not trending away from strike |\n| ADX Moderate | 15 pts | Some structure, not trending hard |\n| MACD Neutrality | 15 pts | No directional acceleration |\n\n**Triggers:**\n- Front-month IV > Back-month IV by > 5%: Inverted term structure\n- Low recent volatility: Price stability\n- RSI neutral: No directional momentum\n- ADX 18-25: Moderate trend structure (not chaos)\n\n**Data Sources:**\n- Primary: Live options chain IV from Yahoo Finance\n- Fallback: Historical volatility proxy (HV 10-day vs 30-day)\n\n**Strike Selection:**\n- ATM strike (rounded to standard interval)\n- Front expiry: nearest available\n- Back expiry: 25+ days after front\n\n**Output:**\n- Single strike (both legs)\n- Front and back expiry dates\n- IV differential (%)\n- Theta advantage description\n\n## Conviction Tiers\n\n| Score | Tier | Action |\n|-------|------|--------|\n| 80-100 | EXECUTE | High conviction — Enter the spread |\n| 60-79 | PREPARE | Favorable — Size the trade |\n| 40-59 | WATCH | Interesting — Add to watchlist |\n| 0-39 | WAIT | Poor conditions — Avoid \u002F No setup |\n\n## Usage\n\n### Vertical Spreads\n\n```bash\n# Basic analysis (auto-detects best strategy)\nconviction-engine AAPL\n\n# Specific strategy\nconviction-engine SPY --strategy bear_call\nconviction-engine QQQ --strategy bull_call --period 2y\n```\n\n### Multi-Leg Strategies\n\n```bash\n# Iron Condor — high IV, range-bound\nconviction-engine SPY --strategy iron_condor\n\n# Butterfly — volatility compression, pinning play\nconviction-engine AAPL --strategy butterfly\n\n# Calendar — inverted IV term structure, theta harvest\nconviction-engine TSLA --strategy calendar\n```\n\n### Multiple Tickers\n\n```bash\nconviction-engine AAPL MSFT GOOGL --strategy bull_put\nconviction-engine SPY QQQ IWM --strategy iron_condor\n```\n\n### JSON Output (for automation)\n\n```bash\nconviction-engine TSLA --strategy butterfly --json\nconviction-engine SPY --strategy calendar --json | jq '.[0].iv_term_structure'\n```\n\n### Full Options\n\n```bash\nconviction-engine \u003Cticker> [ticker...]\n  --strategy {bull_put,bear_call,bull_call,bear_put,iron_condor,butterfly,calendar}\n  --period {1y,2y,3y,5y}\n  --interval {1h,1d,1wk}\n  --json\n```\n\n## Example Outputs\n\n### Iron Condor\n\n```\n================================================================================\nSPY — Iron Condor (Credit)\n================================================================================\nPrice: $681.27 | Score: 31.8\u002F100 → WAIT\n\n[IV Rank +2.5\u002F25]\n  IV Rank (BBW proxy): 5% (VERY_LOW)\n  BBW: 3.17 (1Y range: 2.37 - 18.13)\n  Premiums are THIN — poor risk\u002Freward for credit\n\nStrikes:\n  BUY  680.0P | SELL 685.0P\n  SELL 695.0C | BUY  700.0C\n  Max Profit Zone: $685.0 - $695.0\n  Wing Width: $5.00\n```\n\n### Butterfly\n\n```\n================================================================================\nSPY — Long Butterfly (Debit)\n================================================================================\nPrice: $681.27 | Score: 64.5\u002F100 → PREPARE\n\n[BB Squeeze +27.0\u002F30]\n  Bandwidth: 3.1701 (percentile: 21%)\n  SQUEEZE ACTIVE — 19 consecutive bars\n\nStrikes:\n  BUY 1x 685.0C | SELL 2x 690.0C | BUY 1x 695.0C\n  Max Profit Price: $690.0\n  Profit Zone: ~$685.0 - $695.0\n```\n\n### Calendar Spread\n\n```\n================================================================================\nSPY — Calendar Spread (Debit)\n================================================================================\nPrice: $681.27 | Score: 67.2\u002F100 → PREPARE\n\n[IV Term Structure +30.0\u002F30]\n  Front IV: 27.5% | Back IV: 19.4%\n  Differential: +41.7%\n  INVERTED TERM STRUCTURE — calendar opportunity confirmed\n\nStrikes:\n  Strike: $680.0\n  SELL 2026-02-13 | BUY 2026-03-13\n  Theta Advantage: Front IV > Back IV by 41.7%\n```\n\n## IV Rank Approximation\n\nIV Rank is approximated using **Bollinger Bandwidth (BBW) percentile** over 252 trading days:\n\n```\nIV Rank ≈ (Current BBW - 52wk Low BBW) \u002F (52wk High BBW - 52wk Low BBW) × 100\n```\n\nThis correlation is well-documented: realized volatility (BBW) and implied volatility rank move with ~0.7-0.8 correlation (Sinclair, \"Volatility Trading\", 2013).\n\n## IV Term Structure\n\nFor calendar spreads, the engine attempts to fetch live ATM implied volatility from Yahoo Finance options chains. If unavailable, it falls back to historical volatility term structure (HV 10-day vs HV 30-day) as a proxy.\n\n## Quantitative Modules (v2.3.0)\n\nThe engine now includes four quantitative modules for rigorous strategy validation and optimization:\n\n### 1. Regime Detector (`regime_detector.py`)\n\nMarket regime classification using VIX percentiles:\n- **CRISIS**: VIX > 80th percentile — favors premium selling (iron condors)\n- **HIGH_VOL**: VIX 60-80th — elevated IV benefits credit spreads\n- **NORMAL**: VIX 40-60th — balanced environment, all strategies viable\n- **LOW_VOL**: VIX 20-40th — cheap options favor debit spreads\n- **EUPHORIA**: VIX \u003C 20th — momentum continues, mean reversion brewing\n\n```bash\n# Detect current regime\npython3 scripts\u002Fregime_detector.py\n\n# Get regime-adjusted weights for specific strategy\npython3 scripts\u002Fregime_detector.py --strategy iron_condor --json\n```\n\n**Integration:**\n```python\nfrom regime_detector import RegimeDetector\n\ndetector = RegimeDetector()\nregime, confidence = detector.detect_regime()\nweights = detector.get_regime_weights(regime)\nadjusted_score, reasoning = detector.regime_aware_score(75, regime, 'bull_put')\n```\n\n### 2. Volatility Forecaster (`vol_forecaster.py`)\n\nGARCH-based realized volatility forecasting with VRP analysis:\n- Fits GARCH(1,1) to historical returns\n- Forecasts realized volatility over configurable horizon\n- Calculates volatility risk premium (IV - RV forecast)\n- Provides conviction adjustments based on VRP\n\n```bash\n# Analyze AAPL volatility\npython3 scripts\u002Fvol_forecaster.py AAPL\n\n# Compare IV = 25% vs forecast RV\npython3 scripts\u002Fvol_forecaster.py SPY --iv 0.25 --horizon 5\n```\n\n**Interpretation:**\n- VRP > 5%: Favorable for selling premium (credit spreads)\n- VRP \u003C -5%: Favorable for buying premium (debit spreads)\n- VRP near 0: No volatility edge, focus on directional setup\n\n**Integration:**\n```python\nfrom vol_forecaster import VolatilityForecaster\n\nforecaster = VolatilityForecaster(\"AAPL\")\nparams = forecaster.fit_garch()  # Returns omega, alpha, beta\nforecast = forecaster.forecast_vol(horizon=5)\nvrp, strength, rec = forecaster.vol_risk_premium(iv=0.25, rv_forecast=forecast.annualized_vol)\nadjusted_score, reasoning = forecaster.add_to_conviction(70, vrp_signal, 'bull_put')\n```\n\n### 3. Enhanced Kelly Sizer (`enhanced_kelly.py`)\n\nDrawdown-constrained, correlation-aware position sizing:\n- Full Kelly criterion calculation\n- Drawdown constraint: f_dd = f_kelly × (1 - target_dd \u002F max_dd)\n- Conviction-based Kelly scaling:\n  - 90-100: Half Kelly\n  - 80-89: Quarter Kelly\n  - 60-79: Eighth Kelly\n  - \u003C60: No position\n- Correlation penalty for portfolio context\n\n```bash\n# Calculate position with $390 account\npython3 scripts\u002Fenhanced_kelly.py --loss 80 --win 40 --pop 0.65 --conviction 85\n\n# Include correlation with existing position\npython3 scripts\u002Fenhanced_kelly.py --loss 80 --win 40 --pop 0.65 --conviction 85 --correlation 0.3\n```\n\n**Integration:**\n```python\nfrom enhanced_kelly import EnhancedKellySizer\n\nsizer = EnhancedKellySizer(account_value=390, max_drawdown=0.20)\nresult = sizer.calculate_position(\n    spread_cost=80,\n    max_loss=80,\n    win_amount=40,\n    conviction=85,\n    pop=0.65,\n    existing_correlation=0.0\n)\n# Returns: contracts, total_risk, kelly_fraction, recommendation\n```\n\n### 4. Backtest Validator (`backtest_validator.py`)\n\nWalk-forward validation of conviction scores:\n- Simulates historical trades across ticker universe\n- Validates tier separation (EXECUTE vs WAIT performance)\n- Statistical tests (t-tests, ANOVA)\n- Tier separation scoring (0-1)\n- Weight calibration suggestions\n\n```bash\n# Backtest bull_put on AAPL, MSFT, SPY (2022-2024)\npython3 scripts\u002Fbacktest_validator.py --tickers AAPL MSFT SPY --start 2022-01-01 --end 2024-01-01 --strategy bull_put\n\n# JSON output for analysis\npython3 scripts\u002Fbacktest_validator.py --tickers SPY --json\n```\n\n**Output Metrics:**\n- Win rate per tier\n- Expectancy per tier: (win_rate × avg_win) - (loss_rate × avg_loss)\n- Sharpe ratio per tier\n- P-values for tier differences\n- Separation score (0-1, higher = better discrimination)\n\n**Integration:**\n```python\nfrom backtest_validator import BacktestValidator\n\nvalidator = BacktestValidator(engine, \"2022-01-01\", \"2024-01-01\")\nresults_df = validator.run_walk_forward([\"AAPL\", \"MSFT\"], hold_days=5)\nreport = validator.validate_tiers(results_df)\nprint(f\"Separation score: {report.tier_separation_score:.2f}\")\nprint(f\"EXECUTE vs WAIT p-value: {report.p_values['execute_vs_wait']:.4f}\")\n```\n\n### 5. Quantitative Integration (`quantitative_integration.py`)\n\nUnified interface combining all quantitative modules:\n\n```bash\n# Full quantitative analysis with regime and VRP\npython3 scripts\u002Fquantitative_integration.py AAPL --regime-aware --vol-aware\n\n# With Kelly sizing\npython3 scripts\u002Fquantitative_integration.py SPY --regime-aware --pop 0.65 --max-loss 80 --win-amount 40\n\n# Run backtest validation\npython3 scripts\u002Fquantitative_integration.py --backtest SPY QQQ --start 2022-01-01 --end 2024-01-01\n```\n\n**Integration:**\n```python\nfrom quantitative_integration import QuantConvictionEngine\n\nengine = QuantConvictionEngine(account_value=390, max_drawdown=0.20)\n\n# Analyze with regime and VRP adjustments\nresult = engine.analyze(\"AAPL\", \"bull_put\", regime_aware=True, vol_aware=True)\nprint(f\"Final score: {result.final_score}\")\nprint(f\"Regime: {result.regime}\")\nprint(f\"VRP: {result.vrp_signal.vrp if result.vrp_signal else 'N\u002FA'}\")\n\n# Calculate position size\nsizing = engine.calculate_position(result, pop=0.65, max_loss=80, win_amount=40)\nprint(f\"Contracts: {sizing['contracts']}\")\n\n# Run backtest validation\nreport = engine.run_backtest([\"SPY\", \"QQQ\"], \"2022-01-01\", \"2024-01-01\")\nprint(f\"Recommendation: {report.recommendation}\")\n```\n\n## Academic Foundation\n\n- **Ichimoku Cloud** — Trend structure (Hosoda, 1968)\n- **RSI** — Momentum oscillator (Wilder, 1978)\n- **MACD** — Trend momentum (Appel, 1979)\n- **Bollinger Bands** — Volatility envelopes (Bollinger, 2001)\n- **IV Rank \u002F Term Structure** — Options market microstructure (Sinclair, 2013)\n\nCombining orthogonal signals reduces false-positive rate compared to single-indicator strategies (Pring, 2002; Murphy, 1999).\n\n## Architecture\n\n```\nconviction-engine\u002F\n├── scripts\u002F\n│   ├── conviction-engine              # CLI wrapper (bash)\n│   ├── spread_conviction_engine.py    # Core engine (vertical spreads)\n│   ├── multi_leg_strategies.py        # Multi-leg extensions\n│   ├── quantitative_integration.py    # Unified quantitative interface\n│   ├── regime_detector.py             # VIX-based regime classification\n│   ├── vol_forecaster.py              # GARCH volatility forecasting\n│   ├── enhanced_kelly.py              # Drawdown-constrained Kelly sizing\n│   ├── backtest_validator.py          # Walk-forward validation\n│   ├── quant_scanner.py               # Quantitative options scanner\n│   ├── market_scanner.py              # Technical market scanner\n│   ├── calculator.py                  # Black-Scholes & POP calculator\n│   ├── position_sizer.py              # Kelly position sizing\n│   ├── chain_analyzer.py              # IV surface analyzer\n│   ├── options_math.py                # Core mathematical models\n│   └── setup-venv.sh                  # Environment setup\n├── tests\u002F                             # Unit tests\n│   ├── test_regime_detector.py\n│   ├── test_vol_forecaster.py\n│   ├── test_enhanced_kelly.py\n│   ├── test_backtest_validator.py\n│   └── run_tests.py\n└── SKILL.md                           # This documentation\n```\n\n### Module Separation\n\n- **spread_conviction_engine.py**: Vertical spreads, shared infrastructure (data fetching, indicator computation)\n- **multi_leg_strategies.py**: Iron condors, butterflies, calendars (imports from main engine)\n- **quantitative_integration.py**: Unified interface for regime\u002Fvol\u002FKelly\u002Fbacktest modules\n- **regime_detector.py**: Market regime classification using VIX percentiles\n- **vol_forecaster.py**: GARCH-based realized volatility forecasting\n- **enhanced_kelly.py**: Drawdown-constrained, correlation-aware position sizing\n- **backtest_validator.py**: Walk-forward validation of conviction scores\n\nThis separation keeps concerns clean while avoiding duplication.\n\n## Limitations & Assumptions\n\n### IV Data\n- **Yahoo Finance Limitations**: Options chains may be unavailable after market hours or for low-volume tickers\n- **Fallback**: Historical volatility (HV) proxy is less accurate than live IV but provides signal\n- **IV Rank**: Approximated from BBW; actual IV Rank requires options chain data\n\n### Strike Selection\n- **Approximation**: Strikes derived from Bollinger Band levels (1-sigma \u002F 2-sigma)\n- **Rounding**: Rounded to standard option strike intervals based on stock price\n- **No Live Pricing**: Does not fetch live option premiums; strike selection is structural, not value-optimized\n\n### Data Quality\n- Minimum 180 trading days required for full Ichimoku cloud population\n- Multi-leg strategies require options chains (calendar spreads especially)\n- After-hours analysis may have reduced data quality\n\n### Market Assumptions\n- Assumes normal options market conditions (not extreme volatility events)\n- Strike intervals assume US equity options conventions\n- Not tested on futures, commodities, or non-US markets\n\n## Requirements\n\n- Python 3.10+ (Python 3.14+ supported via pure-python mode)\n- Isolated virtual environment (auto-created on first run)\n- Internet connection (fetches data from Yahoo Finance)\n\n## Installation\n\n```bash\nclawhub install options-spread-conviction-engine\n```\n\nThe skill automatically creates a virtual environment and installs:\n- pandas >= 2.0\n- pandas_ta >= 0.4.0 (pure Python mode on 3.14+)\n- yfinance >= 1.0\n- scipy, tqdm\n\n**Note:** On Python 3.14+, the engine runs in pure Python mode without numba. Performance is slightly reduced but all functionality works correctly.\n\n## Market Scanners\n\nThe engine includes two distinct scanning tools for different trading philosophies:\n\n### 1. Technical Scanner (market_scanner.py)\nAutomates the search for high-conviction plays across entire stock universes using technical indicators (Ichimoku, RSI, MACD, BB).\n\n#### Features\n- Scans S&P 500, Nasdaq 100, or custom ticker lists.\n- Filters for EXECUTE tier (conviction ≥80).\n- Runs position sizing to ensure trades fit account guardrails.\n\n#### Usage\n```bash\n# Scan S&P 500 for high-conviction technical setups\npython3 scripts\u002Fmarket_scanner.py --universe sp500\n```\n\n### 2. Quantitative Scanner (quant_scanner.py)\nA mathematically-rigorous scanner that ignores technical indicators in favor of market microstructure and probability.\n\n#### Features\n- **IV Surface Analysis**: Analyzes skew and term structure.\n- **Monte Carlo POP**: 10,000-run simulations for true Probability of Profit.\n- **EV Optimization**: Finds trades with the highest risk-adjusted mathematical expectancy.\n- **Account-Aware**: Enforces small-account constraints ($100 max risk).\n\n#### Usage\n```bash\n# Maximize POP (Probability of Profit) for SPY\npython3 scripts\u002Fquant_scanner.py SPY --mode pop\n\n# High-expectancy (EV) plays with specific DTE\npython3 scripts\u002Fquant_scanner.py AAPL TSLA --mode ev --min-dte 30\n```\n\n## Calculator & Position Sizer\n\nThe integrated toolchain includes:\n\n### calculator.py\nBlack-Scholes options pricing with support for:\n- Single options: calls, puts\n- Vertical spreads: bull call, bear put\n- Multi-leg: iron condors, butterflies\n- Greeks calculation (delta, gamma, theta, vega, rho)\n- Monte Carlo POP simulation\n\n### position_sizer.py\nKelly criterion position sizing adapted for small accounts:\n- Full Kelly and fractional Kelly (default 0.25)\n- Account guardrails ($390 default, $100 max risk)\n- Trade screening and ranking\n- Strike adjustment suggestions\n\n```python\nfrom position_sizer import calculate_position\n\nresult = calculate_position(\n    account_value=390,\n    max_loss_per_spread=80,\n    win_amount=40,\n    pop=0.65,\n)\n# Returns: contracts, total_risk, recommendation, reason\n```\n\n## Files\n\n- `scripts\u002Fconviction-engine` — Main CLI wrapper for conviction engine\n- `scripts\u002Fspread_conviction_engine.py` — Core engine (vertical spreads)\n- `scripts\u002Fmulti_leg_strategies.py` — Multi-leg extensions (v2.0.0)\n- `scripts\u002Fmarket_scanner.py` — Automated market scanner for EXECUTE plays\n- `scripts\u002Fcalculator.py` — Black-Scholes pricing, Greeks, Monte Carlo POP\n- `scripts\u002Fposition_sizer.py` — Kelly criterion position sizing\n- `scripts\u002Fsetup-venv.sh` — Environment setup\n- `data\u002Fsp500_tickers.txt` — S&P 500 constituents\n- `data\u002Fndx100_tickers.txt` — Nasdaq 100 constituents\n- `assets\u002F` — Documentation and examples\n\n## Version History\n\n- **v2.3.0** (2026-02-13): Quantitative rigor upgrade\n  - Regime Detector: VIX-based market regime classification\n  - Volatility Forecaster: GARCH-based RV forecasting with VRP analysis\n  - Enhanced Kelly Sizer: Drawdown-constrained, correlation-aware position sizing\n  - Backtest Validator: Walk-forward validation with tier separation testing\n  - Quantitative Integration: Unified interface for all quantitative modules\n  - Comprehensive unit test suite for all new modules\n- **v2.2.0** (2026-02-13): Kelly Criterion position sizing with full\u002Fhalf Kelly, edge calculation, and account-aware contract sizing\n- **v2.1.0** (2026-02-12): Added market scanner, integrated calculator and position sizer\n- **v2.0.0** (2026-02-12): Added multi-leg strategies (iron condor, butterfly, calendar)\n- **v1.2.1** (2026-02-09): Volume multiplier, dynamic strike suggestions\n- **v1.1.0** (2026-02-08): Cross-signal weighting, multi-strategy support\n- **v1.0.0** (2026-02-07): Initial bull put spread engine\n\n## License\n\nMIT — Part of the Financial Toolkit for OpenClaw\n","# Options Spread Conviction Engine\n\n**Multi-regime options spread scoring using technical indicators and IV term structure analysis.**\n\n## Install\n\n```bash\nbrew install jq\nnpm install yahoo-finance2\nsudo ln -s \u002Fopt\u002Fhomebrew\u002Fbin\u002Fyahoo-finance \u002Fusr\u002Flocal\u002Fbin\u002Fyf\n```\n\n## Overview\n\nThis engine analyzes any ticker and scores **seven** options strategies across two categories:\n\n### Vertical Spreads (Directional)\n| Strategy | Type | Philosophy | Ideal Setup |\n|----------|------|------------|-------------|\n| **bull_put** | Credit | Mean Reversion | Bullish trend + oversold dip |\n| **bear_call** | Credit | Mean Reversion | Bearish trend + overbought rip |\n| **bull_call** | Debit | Breakout | Strong bullish momentum |\n| **bear_put** | Debit | Breakout | Strong bearish momentum |\n\n### Multi-Leg Strategies (Non-Directional \u002F Theta)\n| Strategy | Type | Philosophy | Ideal Setup |\n|----------|------|------------|-------------|\n| **iron_condor** | Credit | Premium Selling | IV Rank >70, RSI neutral, range-bound |\n| **butterfly** | Debit | Pinning Play | BB squeeze, RSI center, low ADX |\n| **calendar** | Debit | Theta Harvest | Inverted IV term structure (front > back) |\n\n## Scoring Methodology\n\n### Vertical Spreads\n\nWeights vary by strategy type (Credit = Mean Reversion, Debit = Breakout):\n\n#### Credit Spreads (bull_put, bear_call)\n| Indicator | Weight | Purpose |\n|-----------|--------|---------|\n| Ichimoku Cloud | 25 pts | Trend structure & equilibrium |\n| RSI | 20 pts | Entry timing (mean-reversion) |\n| MACD | 15 pts | Momentum confirmation |\n| Bollinger Bands | 25 pts | Volatility regime |\n| ADX | 15 pts | Trend strength validation |\n\n#### Debit Spreads (bull_call, bear_put)\n| Indicator | Weight | Purpose |\n|-----------|--------|---------|\n| Ichimoku Cloud | 20 pts | Trend confirmation |\n| RSI | 10 pts | Directional momentum |\n| MACD | 30 pts | Breakout acceleration |\n| Bollinger Bands | 25 pts | Bandwidth expansion |\n| ADX | 15 pts | Trend strength validation |\n\n### Multi-Leg Strategies\n\n#### Iron Condor (Credit \u002F Range-Bound)\n| Component | Weight | Rationale |\n|-----------|--------|-----------|\n| IV Rank (BBW %) | 25 pts | Rich premiums to sell |\n| RSI Neutrality | 20 pts | No directional momentum |\n| ADX Range-Bound | 20 pts | Weak trend = range structure |\n| Price Position | 20 pts | Centered in range = safe margins |\n| MACD Neutrality | 15 pts | No acceleration in any direction |\n\n**Triggers:**\n- IV Rank > 70: Premium-rich environment\n- RSI 40-60: Neutral momentum\n- ADX \u003C 25: Weak\u002Fno trend\n- Price near %B center: Max profit zone maximized\n\n**Strike Selection:**\n- SELL put at 1-sigma below price (short put)\n- BUY put at 2-sigma below (long put — wing)\n- SELL call at 1-sigma above price (short call)\n- BUY call at 2-sigma above (long call — wing)\n\n**Output:**\n- All 4 strikes (put_long, put_short, call_short, call_long)\n- Max profit zone (width between short strikes)\n- Wing width\n\n#### Butterfly (Debit \u002F Volatility Compression)\n| Component | Weight | Rationale |\n|-----------|--------|-----------|\n| BB Squeeze | 30 pts | Vol compression = narrow range |\n| RSI Neutrality | 25 pts | Price at equilibrium |\n| ADX Weakness | 20 pts | No directional trend at all |\n| Price Centering | 15 pts | At center of range for max profit |\n| MACD Flatness | 10 pts | No momentum |\n\n**Triggers:**\n- BBW percentile \u003C 25: Squeeze active\n- RSI 45-55: Dead-center (tighter than condor)\n- ADX \u003C 20: Very weak trend\n- MACD histogram near zero\n- Price at %B = 0.50\n\n**Strike Selection:**\n- BUY 1 call at strike below center (lower wing)\n- SELL 2 calls at center strike (body)\n- BUY 1 call at strike above center (upper wing)\n\n**Output:**\n- 3 strikes (lower_long, middle_short, upper_long)\n- Max profit price (= middle strike)\n- Profit zone (approximate breakevens)\n\n#### Calendar Spread (Debit \u002F Theta Harvesting)\n| Component | Weight | Rationale |\n|-----------|--------|-----------|\n| IV Term Structure | 30 pts | Front IV > Back IV = theta edge |\n| Price Stability | 20 pts | Price stays near strike |\n| RSI Neutrality | 20 pts | Not trending away from strike |\n| ADX Moderate | 15 pts | Some structure, not trending hard |\n| MACD Neutrality | 15 pts | No directional acceleration |\n\n**Triggers:**\n- Front-month IV > Back-month IV by > 5%: Inverted term structure\n- Low recent volatility: Price stability\n- RSI neutral: No directional momentum\n- ADX 18-25: Moderate trend structure (not chaos)\n\n**Data Sources:**\n- Primary: Live options chain IV from Yahoo Finance\n- Fallback: Historical volatility proxy (HV 10-day vs 30-day)\n\n**Strike Selection:**\n- ATM strike (rounded to standard interval)\n- Front expiry: nearest available\n- Back expiry: 25+ days after front\n\n**Output:**\n- Single strike (both legs)\n- Front and back expiry dates\n- IV differential (%)\n- Theta advantage description\n\n## Conviction Tiers\n\n| Score | Tier | Action |\n|-------|------|--------|\n| 80-100 | EXECUTE | High conviction — Enter the spread |\n| 60-79 | PREPARE | Favorable — Size the trade |\n| 40-59 | WATCH | Interesting — Add to watchlist |\n| 0-39 | WAIT | Poor conditions — Avoid \u002F No setup |\n\n## Usage\n\n### Vertical Spreads\n\n```bash\n# Basic analysis (auto-detects best strategy)\nconviction-engine AAPL\n\n# Specific strategy\nconviction-engine SPY --strategy bear_call\nconviction-engine QQQ --strategy bull_call --period 2y\n```\n\n### Multi-Leg Strategies\n\n```bash\n# Iron Condor — high IV, range-bound\nconviction-engine SPY --strategy iron_condor\n\n# Butterfly — volatility compression, pinning play\nconviction-engine AAPL --strategy butterfly\n\n# Calendar — inverted IV term structure, theta harvest\nconviction-engine TSLA --strategy calendar\n```\n\n### Multiple Tickers\n\n```bash\nconviction-engine AAPL MSFT GOOGL --strategy bull_put\nconviction-engine SPY QQQ IWM --strategy iron_condor\n```\n\n### JSON Output (for automation)\n\n```bash\nconviction-engine TSLA --strategy butterfly --json\nconviction-engine SPY --strategy calendar --json | jq '.[0].iv_term_structure'\n```\n\n### Full Options\n\n```bash\nconviction-engine \u003Cticker> [ticker...]\n  --strategy {bull_put,bear_call,bull_call,bear_put,iron_condor,butterfly,calendar}\n  --period {1y,2y,3y,5y}\n  --interval {1h,1d,1wk}\n  --json\n```\n\n## Example Outputs\n\n### Iron Condor\n\n```\n================================================================================\nSPY — Iron Condor (Credit)\n================================================================================\nPrice: $681.27 | Score: 31.8\u002F100 → WAIT\n\n[IV Rank +2.5\u002F25]\n  IV Rank (BBW proxy): 5% (VERY_LOW)\n  BBW: 3.17 (1Y range: 2.37 - 18.13)\n  Premiums are THIN — poor risk\u002Freward for credit\n\nStrikes:\n  BUY  680.0P | SELL 685.0P\n  SELL 695.0C | BUY  700.0C\n  Max Profit Zone: $685.0 - $695.0\n  Wing Width: $5.00\n```\n\n### Butterfly\n\n```\n================================================================================\nSPY — Long Butterfly (Debit)\n================================================================================\nPrice: $681.27 | Score: 64.5\u002F100 → PREPARE\n\n[BB Squeeze +27.0\u002F30]\n  Bandwidth: 3.1701 (percentile: 21%)\n  SQUEEZE ACTIVE — 19 consecutive bars\n\nStrikes:\n  BUY 1x 685.0C | SELL 2x 690.0C | BUY 1x 695.0C\n  Max Profit Price: $690.0\n  Profit Zone: ~$685.0 - $695.0\n```\n\n### Calendar Spread\n\n```\n================================================================================\nSPY — Calendar Spread (Debit)\n================================================================================\nPrice: $681.27 | Score: 67.2\u002F100 → PREPARE\n\n[IV Term Structure +30.0\u002F30]\n  Front IV: 27.5% | Back IV: 19.4%\n  Differential: +41.7%\n  INVERTED TERM STRUCTURE — calendar opportunity confirmed\n\nStrikes:\n  Strike: $680.0\n  SELL 2026-02-13 | BUY 2026-03-13\n  Theta Advantage: Front IV > Back IV by 41.7%\n```\n\n## IV Rank Approximation\n\nIV Rank is approximated using **Bollinger Bandwidth (BBW) percentile** over 252 trading days:\n\n```\nIV Rank ≈ (Current BBW - 52wk Low BBW) \u002F (52wk High BBW - 52wk Low BBW) × 100\n```\n\nThis correlation is well-documented: realized volatility (BBW) and implied volatility rank move with ~0.7-0.8 correlation (Sinclair, \"Volatility Trading\", 2013).\n\n## IV Term Structure\n\nFor calendar spreads, the engine attempts to fetch live ATM implied volatility from Yahoo Finance options chains. If unavailable, it falls back to historical volatility term structure (HV 10-day vs HV 30-day) as a proxy.\n\n## Quantitative Modules (v2.3.0)\n\nThe engine now includes four quantitative modules for rigorous strategy validation and optimization:\n\n### 1. Regime Detector (`regime_detector.py`)\n\nMarket regime classification using VIX percentiles:\n- **CRISIS**: VIX > 80th percentile — favors premium selling (iron condors)\n- **HIGH_VOL**: VIX 60-80th — elevated IV benefits credit spreads\n- **NORMAL**: VIX 40-60th — balanced environment, all strategies viable\n- **LOW_VOL**: VIX 20-40th — cheap options favor debit spreads\n- **EUPHORIA**: VIX \u003C 20th — momentum continues, mean reversion brewing\n\n```bash\n# Detect current regime\npython3 scripts\u002Fregime_detector.py\n\n# Get regime-adjusted weights for specific strategy\npython3 scripts\u002Fregime_detector.py --strategy iron_condor --json\n```\n\n**Integration:**\n```python\nfrom regime_detector import RegimeDetector\n\ndetector = RegimeDetector()\nregime, confidence = detector.detect_regime()\nweights = detector.get_regime_weights(regime)\nadjusted_score, reasoning = detector.regime_aware_score(75, regime, 'bull_put')\n```\n\n### 2. Volatility Forecaster (`vol_forecaster.py`)\n\nGARCH-based realized volatility forecasting with VRP analysis:\n- Fits GARCH(1,1) to historical returns\n- Forecasts realized volatility over configurable horizon\n- Calculates volatility risk premium (IV - RV forecast)\n- Provides conviction adjustments based on VRP\n\n```bash\n# Analyze AAPL volatility\npython3 scripts\u002Fvol_forecaster.py AAPL\n\n# Compare IV = 25% vs forecast RV\npython3 scripts\u002Fvol_forecaster.py SPY --iv 0.25 --horizon 5\n```\n\n**Interpretation:**\n- VRP > 5%: Favorable for selling premium (credit spreads)\n- VRP \u003C -5%: Favorable for buying premium (debit spreads)\n- VRP near 0: No volatility edge, focus on directional setup\n\n**Integration:**\n```python\nfrom vol_forecaster import VolatilityForecaster\n\nforecaster = VolatilityForecaster(\"AAPL\")\nparams = forecaster.fit_garch()  # Returns omega, alpha, beta\nforecast = forecaster.forecast_vol(horizon=5)\nvrp, strength, rec = forecaster.vol_risk_premium(iv=0.25, rv_forecast=forecast.annualized_vol)\nadjusted_score, reasoning = forecaster.add_to_conviction(70, vrp_signal, 'bull_put')\n```\n\n### 3. Enhanced Kelly Sizer (`enhanced_kelly.py`)\n\nDrawdown-constrained, correlation-aware position sizing:\n- Full Kelly criterion calculation\n- Drawdown constraint: f_dd = f_kelly × (1 - target_dd \u002F max_dd)\n- Conviction-based Kelly scaling:\n  - 90-100: Half Kelly\n  - 80-89: Quarter Kelly\n  - 60-79: Eighth Kelly\n  - \u003C60: No position\n- Correlation penalty for portfolio context\n\n```bash\n# Calculate position with $390 account\npython3 scripts\u002Fenhanced_kelly.py --loss 80 --win 40 --pop 0.65 --conviction 85\n\n# Include correlation with existing position\npython3 scripts\u002Fenhanced_kelly.py --loss 80 --win 40 --pop 0.65 --conviction 85 --correlation 0.3\n```\n\n**Integration:**\n```python\nfrom enhanced_kelly import EnhancedKellySizer\n\nsizer = EnhancedKellySizer(account_value=390, max_drawdown=0.20)\nresult = sizer.calculate_position(\n    spread_cost=80,\n    max_loss=80,\n    win_amount=40,\n    conviction=85,\n    pop=0.65,\n    existing_correlation=0.0\n)\n# Returns: contracts, total_risk, kelly_fraction, recommendation\n```\n\n### 4. Backtest Validator (`backtest_validator.py`)\n\nWalk-forward validation of conviction scores:\n- Simulates historical trades across ticker universe\n- Validates tier separation (EXECUTE vs WAIT performance)\n- Statistical tests (t-tests, ANOVA)\n- Tier separation scoring (0-1)\n- Weight calibration suggestions\n\n```bash\n# Backtest bull_put on AAPL, MSFT, SPY (2022-2024)\npython3 scripts\u002Fbacktest_validator.py --tickers AAPL MSFT SPY --start 2022-01-01 --end 2024-01-01 --strategy bull_put\n\n# JSON output for analysis\npython3 scripts\u002Fbacktest_validator.py --tickers SPY --json\n```\n\n**Output Metrics:**\n- Win rate per tier\n- Expectancy per tier: (win_rate × avg_win) - (loss_rate × avg_loss)\n- Sharpe ratio per tier\n- P-values for tier differences\n- Separation score (0-1, higher = better discrimination)\n\n**Integration:**\n```python\nfrom backtest_validator import BacktestValidator\n\nvalidator = BacktestValidator(engine, \"2022-01-01\", \"2024-01-01\")\nresults_df = validator.run_walk_forward([\"AAPL\", \"MSFT\"], hold_days=5)\nreport = validator.validate_tiers(results_df)\nprint(f\"Separation score: {report.tier_separation_score:.2f}\")\nprint(f\"EXECUTE vs WAIT p-value: {report.p_values['execute_vs_wait']:.4f}\")\n```\n\n### 5. Quantitative Integration (`quantitative_integration.py`)\n\nUnified interface combining all quantitative modules:\n\n```bash\n# Full quantitative analysis with regime and VRP\npython3 scripts\u002Fquantitative_integration.py AAPL --regime-aware --vol-aware\n\n# With Kelly sizing\npython3 scripts\u002Fquantitative_integration.py SPY --regime-aware --pop 0.65 --max-loss 80 --win-amount 40\n\n# Run backtest validation\npython3 scripts\u002Fquantitative_integration.py --backtest SPY QQQ --start 2022-01-01 --end 2024-01-01\n```\n\n**Integration:**\n```python\nfrom quantitative_integration import QuantConvictionEngine\n\nengine = QuantConvictionEngine(account_value=390, max_drawdown=0.20)\n\n# Analyze with regime and VRP adjustments\nresult = engine.analyze(\"AAPL\", \"bull_put\", regime_aware=True, vol_aware=True)\nprint(f\"Final score: {result.final_score}\")\nprint(f\"Regime: {result.regime}\")\nprint(f\"VRP: {result.vrp_signal.vrp if result.vrp_signal else 'N\u002FA'}\")\n\n# Calculate position size\nsizing = engine.calculate_position(result, pop=0.65, max_loss=80, win_amount=40)\nprint(f\"Contracts: {sizing['contracts']}\")\n\n# Run backtest validation\nreport = engine.run_backtest([\"SPY\", \"QQQ\"], \"2022-01-01\", \"2024-01-01\")\nprint(f\"Recommendation: {report.recommendation}\")\n```\n\n## Academic Foundation\n\n- **Ichimoku Cloud** — Trend structure (Hosoda, 1968)\n- **RSI** — Momentum oscillator (Wilder, 1978)\n- **MACD** — Trend momentum (Appel, 1979)\n- **Bollinger Bands** — Volatility envelopes (Bollinger, 2001)\n- **IV Rank \u002F Term Structure** — Options market microstructure (Sinclair, 2013)\n\nCombining orthogonal signals reduces false-positive rate compared to single-indicator strategies (Pring, 2002; Murphy, 1999).\n\n## Architecture\n\n```\nconviction-engine\u002F\n├── scripts\u002F\n│   ├── conviction-engine              # CLI wrapper (bash)\n│   ├── spread_conviction_engine.py    # Core engine (vertical spreads)\n│   ├── multi_leg_strategies.py        # Multi-leg extensions\n│   ├── quantitative_integration.py    # Unified quantitative interface\n│   ├── regime_detector.py             # VIX-based regime classification\n│   ├── vol_forecaster.py              # GARCH volatility forecasting\n│   ├── enhanced_kelly.py              # Drawdown-constrained Kelly sizing\n│   ├── backtest_validator.py          # Walk-forward validation\n│   ├── quant_scanner.py               # Quantitative options scanner\n│   ├── market_scanner.py              # Technical market scanner\n│   ├── calculator.py                  # Black-Scholes & POP calculator\n│   ├── position_sizer.py              # Kelly position sizing\n│   ├── chain_analyzer.py              # IV surface analyzer\n│   ├── options_math.py                # Core mathematical models\n│   └── setup-venv.sh                  # Environment setup\n├── tests\u002F                             # Unit tests\n│   ├── test_regime_detector.py\n│   ├── test_vol_forecaster.py\n│   ├── test_enhanced_kelly.py\n│   ├── test_backtest_validator.py\n│   └── run_tests.py\n└── SKILL.md                           # This documentation\n```\n\n### Module Separation\n\n- **spread_conviction_engine.py**: Vertical spreads, shared infrastructure (data fetching, indicator computation)\n- **multi_leg_strategies.py**: Iron condors, butterflies, calendars (imports from main engine)\n- **quantitative_integration.py**: Unified interface for regime\u002Fvol\u002FKelly\u002Fbacktest modules\n- **regime_detector.py**: Market regime classification using VIX percentiles\n- **vol_forecaster.py**: GARCH-based realized volatility forecasting\n- **enhanced_kelly.py**: Drawdown-constrained, correlation-aware position sizing\n- **backtest_validator.py**: Walk-forward validation of conviction scores\n\nThis separation keeps concerns clean while avoiding duplication.\n\n## Limitations & Assumptions\n\n### IV Data\n- **Yahoo Finance Limitations**: Options chains may be unavailable after market hours or for low-volume tickers\n- **Fallback**: Historical volatility (HV) proxy is less accurate than live IV but provides signal\n- **IV Rank**: Approximated from BBW; actual IV Rank requires options chain data\n\n### Strike Selection\n- **Approximation**: Strikes derived from Bollinger Band levels (1-sigma \u002F 2-sigma)\n- **Rounding**: Rounded to standard option strike intervals based on stock price\n- **No Live Pricing**: Does not fetch live option premiums; strike selection is structural, not value-optimized\n\n### Data Quality\n- Minimum 180 trading days required for full Ichimoku cloud population\n- Multi-leg strategies require options chains (calendar spreads especially)\n- After-hours analysis may have reduced data quality\n\n### Market Assumptions\n- Assumes normal options market conditions (not extreme volatility events)\n- Strike intervals assume US equity options conventions\n- Not tested on futures, commodities, or non-US markets\n\n## Requirements\n\n- Python 3.10+ (Python 3.14+ supported via pure-python mode)\n- Isolated virtual environment (auto-created on first run)\n- Internet connection (fetches data from Yahoo Finance)\n\n## Installation\n\n```bash\nclawhub install options-spread-conviction-engine\n```\n\nThe skill automatically creates a virtual environment and installs:\n- pandas >= 2.0\n- pandas_ta >= 0.4.0 (pure Python mode on 3.14+)\n- yfinance >= 1.0\n- scipy, tqdm\n\n**Note:** On Python 3.14+, the engine runs in pure Python mode without numba. Performance is slightly reduced but all functionality works correctly.\n\n## Market Scanners\n\nThe engine includes two distinct scanning tools for different trading philosophies:\n\n### 1. Technical Scanner (market_scanner.py)\nAutomates the search for high-conviction plays across entire stock universes using technical indicators (Ichimoku, RSI, MACD, BB).\n\n#### Features\n- Scans S&P 500, Nasdaq 100, or custom ticker lists.\n- Filters for EXECUTE tier (conviction ≥80).\n- Runs position sizing to ensure trades fit account guardrails.\n\n#### Usage\n```bash\n# Scan S&P 500 for high-conviction technical setups\npython3 scripts\u002Fmarket_scanner.py --universe sp500\n```\n\n### 2. Quantitative Scanner (quant_scanner.py)\nA mathematically-rigorous scanner that ignores technical indicators in favor of market microstructure and probability.\n\n#### Features\n- **IV Surface Analysis**: Analyzes skew and term structure.\n- **Monte Carlo POP**: 10,000-run simulations for true Probability of Profit.\n- **EV Optimization**: Finds trades with the highest risk-adjusted mathematical expectancy.\n- **Account-Aware**: Enforces small-account constraints ($100 max risk).\n\n#### Usage\n```bash\n# Maximize POP (Probability of Profit) for SPY\npython3 scripts\u002Fquant_scanner.py SPY --mode pop\n\n# High-expectancy (EV) plays with specific DTE\npython3 scripts\u002Fquant_scanner.py AAPL TSLA --mode ev --min-dte 30\n```\n\n## Calculator & Position Sizer\n\nThe integrated toolchain includes:\n\n### calculator.py\nBlack-Scholes options pricing with support for:\n- Single options: calls, puts\n- Vertical spreads: bull call, bear put\n- Multi-leg: iron condors, butterflies\n- Greeks calculation (delta, gamma, theta, vega, rho)\n- Monte Carlo POP simulation\n\n### position_sizer.py\nKelly criterion position sizing adapted for small accounts:\n- Full Kelly and fractional Kelly (default 0.25)\n- Account guardrails ($390 default, $100 max risk)\n- Trade screening and ranking\n- Strike adjustment suggestions\n\n```python\nfrom position_sizer import calculate_position\n\nresult = calculate_position(\n    account_value=390,\n    max_loss_per_spread=80,\n    win_amount=40,\n    pop=0.65,\n)\n# Returns: contracts, total_risk, recommendation, reason\n```\n\n## Files\n\n- `scripts\u002Fconviction-engine` — Main CLI wrapper for conviction engine\n- `scripts\u002Fspread_conviction_engine.py` — Core engine (vertical spreads)\n- `scripts\u002Fmulti_leg_strategies.py` — Multi-leg extensions (v2.0.0)\n- `scripts\u002Fmarket_scanner.py` — Automated market scanner for EXECUTE plays\n- `scripts\u002Fcalculator.py` — Black-Scholes pricing, Greeks, Monte Carlo POP\n- `scripts\u002Fposition_sizer.py` — Kelly criterion position sizing\n- `scripts\u002Fsetup-venv.sh` — Environment setup\n- `data\u002Fsp500_tickers.txt` — S&P 500 constituents\n- `data\u002Fndx100_tickers.txt` — Nasdaq 100 constituents\n- `assets\u002F` — Documentation and examples\n\n## Version History\n\n- **v2.3.0** (2026-02-13): Quantitative rigor upgrade\n  - Regime Detector: VIX-based market regime classification\n  - Volatility Forecaster: GARCH-based RV forecasting with VRP analysis\n  - Enhanced Kelly Sizer: Drawdown-constrained, correlation-aware position sizing\n  - Backtest Validator: Walk-forward validation with tier separation testing\n  - Quantitative Integration: Unified interface for all quantitative modules\n  - Comprehensive unit test suite for all new modules\n- **v2.2.0** (2026-02-13): Kelly Criterion position sizing with full\u002Fhalf Kelly, edge calculation, and account-aware contract sizing\n- **v2.1.0** (2026-02-12): Added market scanner, integrated calculator and position sizer\n- **v2.0.0** (2026-02-12): Added multi-leg strategies (iron condor, butterfly, calendar)\n- **v1.2.1** (2026-02-09): Volume multiplier, dynamic strike suggestions\n- **v1.1.0** (2026-02-08): Cross-signal weighting, multi-strategy support\n- **v1.0.0** (2026-02-07): Initial bull put spread engine\n\n## License\n\nMIT — Part of the Financial Toolkit for OpenClaw\n",{"name":5,"author":24,"version":25,"metadata":26,"description":7},"Leonardo Da Pinchy","2.3.0",{"openclaw":27},{"emoji":28,"install":29,"requires":35},"📊",[30],{"id":31,"kind":32,"label":33,"command":34},"venv-setup","exec","Setup isolated Python environment with dependencies","cd {baseDir} && python3 scripts\u002Fsetup-venv.sh",{"bins":36},[37],"python3","main","f9d3fe7cf9ac8f1ea63a0d96e98e1f510a3814db","skills\u002Fadamnaghs\u002Foptions-spread-conviction-engine",1,"https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills","https:\u002F\u002Fgithub.com\u002Fjavimosch","intrane.fr","Building robust, open-source infrastructure for the commons. AI-leveraged, self-hosted, built to last.","2026-06-07 03:34:58",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add javimosch\u002Fopen-claw-skills --skill options-spread-conviction-engine",{"tool":53,"command":54},"bunx","bunx skills add javimosch\u002Fopen-claw-skills --skill options-spread-conviction-engine",{"tool":56,"command":57},"pnpm","pnpm dlx skills add javimosch\u002Fopen-claw-skills --skill options-spread-conviction-engine","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fadamnaghs\u002Foptions-spread-conviction-engine\u002FSKILL.md",true,[],[62,70,77,84,91,98],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":69},"01M778GGXG2VQ0YF31W2MKGMQZ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":69},"01M778G7BH8SBJ9FJ6C3G7CB1K","ceaser","Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir\u002FUltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":69},"01M778FYCJQZWFKKX5FYMK3S47","ceaser-send","Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir\u002FUltraHonk zero-knowledge proofs.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser-send\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":69},"01M778FQQNSEYA3HJKZBPQ4M9Z","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":69},"01M778FGVZX7QA2TF9BFMM37FY","moldium","Post and manage content on the Moldium blog platform. Triggered by \"post to Moldium\", \"write a blog post\", \"publish an article\", etc.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyom45\u002Fmoldium\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":69},"01M778F88D8PQ9MQ0KNW2TJ8ZH","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http:\u002F\u002Fweakaccept.top:8000\u002F.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[]]