{"id":"396d7b02-7e94-4d41-9438-273fc394155b","entityType":"agent","slug":"clawhub-ssidharhubble-options-trading-backtester","name":"Options Trading Backtester","canonicalUrl":"https://www.xpersona.co/agent/clawhub-ssidharhubble-options-trading-backtester","canonicalPath":"/agent/clawhub-ssidharhubble-options-trading-backtester","generatedAt":"2026-10-10T10:52:47.948Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T04:47:52.041Z","emptyReason":null},"description":"Automated options trading backtester tool. Built by Shubh's autonomous Money Machine — self-improving based on live market data. Skill: Options Trading Backtester Owner: ssidharhubble Summary: Automated options trading backtester tool. Built by Shubh's autonomous Money Machine — self-improving based on live market data. Tags: latest:1.0.18 Version history: v1.0.18 | 2026-06-22T14:02:55.396Z | auto - Updated version number in SKILL.md from 1.0.17 to 1.0.18. - No other functional or content changes were made. v1.0.17 | 2026-06-22T13:54:20.923Z |","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.7K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s1751xfhp40q8vjjqd22y5vaw584gpke:options-trading-backtester","sourceUrl":"https://clawhub.ai/ssidharhubble/options-trading-backtester","homepage":"https://clawhub.ai/ssidharhubble/skills/options-trading-backtester","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/ssidharhubble/options-trading-backtester","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/ssidharhubble/skills/options-trading-backtester","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":64,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Automated options trading backtester tool. Built by Shubh's autonomous Money Machine — self-improving based on live market data. Skill: Options Trading Backtest"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T04:47:52.041Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T04:47:52.041Z","emptyReason":null},"stars":null,"forks":null,"downloads":1673,"packageName":null,"latestVersion":"1.0.18","tractionLabel":"1.7K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T04:47:52.041Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T04:47:52.041Z","lastCrawledAt":"2026-10-10T04:47:52.041Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T04:47:52.041Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.18","createdAt":"2026-06-22T14:02:55.396Z","changelog":"- Updated version number in SKILL.md from 1.0.17 to 1.0.18. - No other functional or content changes were made.","fileCount":3,"zipByteSize":4074},{"version":"1.0.17","createdAt":"2026-06-22T13:54:20.923Z","changelog":"- Bumped version to 1.0.17. - Documentation updated in SKILL.md; no functional or feature changes.","fileCount":3,"zipByteSize":4110},{"version":"1.0.16","createdAt":"2026-06-22T13:10:49.726Z","changelog":"- Removed the skill-card.md file. - No user-facing changes to features, documentation, or functionality. - Internal documentation and packaging updated.","fileCount":3,"zipByteSize":4092},{"version":"1.0.15","createdAt":"2026-06-05T13:14:18.229Z","changelog":"- Removed redundant skill-card.md file. - Minor maintenance update; documentation and core functionality remain unchanged.","fileCount":3,"zipByteSize":4257},{"version":"1.0.14","createdAt":"2026-05-17T13:12:10.229Z","changelog":"- Version bump from 1.0.13 to 1.0.14 in SKILL.md. - No other changes detected.","fileCount":3,"zipByteSize":4145},{"version":"1.0.13","createdAt":"2026-05-16T13:14:15.616Z","changelog":"- Updated version to 1.0.13 in SKILL.md. - No functional changes; documentation version number only.","fileCount":2,"zipByteSize":3047},{"version":"1.0.12","createdAt":"2026-05-15T13:10:58.679Z","changelog":"- Bumped version to 1.0.12 (from 1.0.11) in SKILL.md. - No other content changes; this update is documentation-related only.","fileCount":2,"zipByteSize":3047},{"version":"1.0.11","createdAt":"2026-05-14T13:11:52.643Z","changelog":"- Version bumped to 1.0.11. - No code or feature changes—documentation or metadata updated only.","fileCount":2,"zipByteSize":3047}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s1751xfhp40q8vjjqd22y5vaw584gpke:options-trading-backtester","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ssidharhubble-options-trading-backtester/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ssidharhubble-options-trading-backtester/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ssidharhubble-options-trading-backtester/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-ssidharhubble-options-trading-backtester/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-ssidharhubble-options-trading-backtester/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-ssidharhubble-options-trading-backtester/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T10:52:47.947Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ssidharhubble-options-trading-backtester/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ssidharhubble-options-trading-backtester/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ssidharhubble-options-trading-backtester/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ssidharhubble-options-trading-backtester/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-10T04:47:52.041Z","emptyReason":null},"readme":"Skill: Options Trading Backtester\n\nOwner: ssidharhubble\n\nSummary: Automated options trading backtester tool. Built by Shubh's autonomous Money Machine — self-improving based on live market data.\n\nTags: latest:1.0.18\n\nVersion history:\n\nv1.0.18 | 2026-06-22T14:02:55.396Z | auto\n\n- Updated version number in SKILL.md from 1.0.17 to 1.0.18.\n- No other functional or content changes were made.\n\nv1.0.17 | 2026-06-22T13:54:20.923Z | auto\n\n- Bumped version to 1.0.17.\n- Documentation updated in SKILL.md; no functional or feature changes.\n\nv1.0.16 | 2026-06-22T13:10:49.726Z | auto\n\n- Removed the skill-card.md file.\n- No user-facing changes to features, documentation, or functionality.\n- Internal documentation and packaging updated.\n\nv1.0.15 | 2026-06-05T13:14:18.229Z | auto\n\n- Removed redundant skill-card.md file.\n- Minor maintenance update; documentation and core functionality remain unchanged.\n\nv1.0.14 | 2026-05-17T13:12:10.229Z | auto\n\n- Version bump from 1.0.13 to 1.0.14 in SKILL.md.  \n- No other changes detected.\n\nv1.0.13 | 2026-05-16T13:14:15.616Z | auto\n\n- Updated version to 1.0.13 in SKILL.md.\n- No functional changes; documentation version number only.\n\nv1.0.12 | 2026-05-15T13:10:58.679Z | auto\n\n- Bumped version to 1.0.12 (from 1.0.11) in SKILL.md.\n- No other content changes; this update is documentation-related only.\n\nv1.0.11 | 2026-05-14T13:11:52.643Z | auto\n\n- Version bumped to 1.0.11.\n- No code or feature changes—documentation or metadata updated only.\n\nv1.0.10 | 2026-05-04T13:43:55.731Z | auto\n\n- Version bump from 1.0.9 to 1.0.10.\n- No functional or documentation changes; version update only.\n\nv1.0.9 | 2026-05-04T13:30:07.604Z | auto\n\n- Bumped version number from 1.0.8 to 1.0.9 in SKILL.md.\n- No other content or functional changes included in this update.\n\nv1.0.8 | 2026-05-03T13:41:28.671Z | auto\n\n- Version updated to 1.0.8 in SKILL.md.\n- No other functional or documentation changes detected.\n\nv1.0.7 | 2026-05-03T13:30:38.089Z | auto\n\n- Bumped version to 1.0.7.\n- Documentation update only: no code or logic changes, just revision to SKILL.md.\n\nv1.0.6 | 2026-05-02T13:41:30.450Z | auto\n\n- Version bumped from 1.0.5 to 1.0.6 in SKILL.md.\n- No changes to code, features, or documentation except the version update.\n\nv1.0.5 | 2026-05-02T13:27:18.500Z | auto\n\n- Bumped version to 1.0.5.\n- No functional or feature changes; documentation updated only.\n\nv1.0.4 | 2026-05-01T13:21:08.387Z | auto\n\n- Bumped version to 1.0.4.\n- Documentation or metadata updated in SKILL.md.\n- No functional or interface changes in code.\n\nv1.0.3 | 2026-04-30T13:18:58.200Z | auto\n\n- Updated version number in SKILL.md from 1.0.2 to 1.0.3.\n- No other content or logic changes present.\n\nv1.0.2 | 2026-04-30T01:50:20.895Z | auto\n\n- Expanded and clarified skill description with feature highlights, supported strategies, and usage scenarios.\n- Added a full example of the Python backtest engine script directly in the documentation.\n- Provided detailed usage instructions and sample command-line invocations for all supported strategies.\n- Documented default config in JSON for easier customization.\n- Listed error handling rules and specific backtester assumptions (e.g., IV cutoffs, commissions).\n- Updated compatibility, tags, and metadata for clarity and discoverability.\n\nv1.0.1 | 2026-04-30T01:14:36.501Z | auto\n\n- Bumped version to 1.0.1.\n- No functional or documentation changes aside from the version number update in SKILL.md.\n\nv1.0.0 | 2026-04-30T00:13:44.714Z | auto\n\nInitial release of automated options trading backtester.\n\n- Automates backtesting of options trading strategies.\n- CLI interface with `scripts/main.py` for customizable inputs.\n- Designed for rapid prototyping and early-stage validation.\n- Compatible with Python 3.12+.\n\nArchive index:\n\nArchive v1.0.18: 3 files, 4074 bytes\n\nFiles: skill-card.md (1747b), SKILL.md (7289b), _meta.json (146b)\n\nFile v1.0.18:SKILL.md\n\n---\nname: options-trading-backtester\nversion: 1.0.18\ndescription: |\n  Build and run options strategy backtests in Python. Supports Iron Condor, Strangle,\n  Calendar Spread, Vertical Credit Spread. Tests against historical data with realistic\n  slippage, commission ($0.65/contract), and IV crush modeling. Outputs Sharpe ratio,\n  win rate, max drawdown, expectancy, and equity curve. Use when user asks to backtest\n  an options strategy, test a config, or analyze trade history.\ncompatibility: Python 3.10+, pandas, numpy, scipy, matplotlib. Optional: yfinance (free data).\nmetadata:\n  author: ssyopro.zo.computer\n  category: finance\n  display-name: Options Trading Backtester\n  tags: options, backtesting, trading-strategy, python, quant-finance, iron-condor, strangle\n---\n\n# Options Trading Backtester\n\nEvent-driven backtester for options strategies. Tests against synthetic or real historical data.\n\n## Strategy Types\n\n| Strategy | Description | Best For |\n|---|---|---|\n| Iron Condor | Sell OTM put spread + OTM call spread | Neutral markets, high IV |\n| Strangle | Sell OTM put + OTM call, same expiration | Low-cost setup, volatile markets |\n| Calendar Spread | Buy long-dated, sell short-dated same strike | Time decay, mean reversion |\n| Vertical Credit Spread | Bull put or Bear call spread | Directional trades with defined risk |\n\n## Backtest Engine\n\n```python\n#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\": round(width * 100, 2),\n        \"win_rate\": round((pnl_arr > 0).mean() * 100, 1),\n        \"avg_win\": round(pnl_arr[pnl_arr > 0].mean(), 2) if (pnl_arr > 0).any() else 0,\n        \"avg_loss\": round(pnl_arr[pnl_arr < 0].mean(), 2) if (pnl_arr < 0).any() else 0,\n        \"sharpe\": round(pnl_arr.mean() / (pnl_arr.std() + 1e-9), 2),\n        \"max_dd\": round(pnl_arr.min(), 2),\n        \"expectancy\": round((pnl_arr > 0).mean() * pnl_arr[pnl_arr > 0].mean() - \n                           (pnl_arr < 0).mean() * abs(pnl_arr[pnl_arr < 0].mean()), 2),\n        \"sample_size\": len(outcomes)\n    }\n\ndef run_backtest(strategy: str, symbol: str = \"SPY\", iv: float = 0.30, \n                 days: int = 45, short_delta: float = 0.20, width: float = 5.0):\n    results = []\n    for _ in range(20):  # 20 simulated entry points\n        price = np.random.uniform(400, 500)\n        r = simulate_iron_condor(price, iv, days, short_delta, width)\n        results.append(r)\n    \n    total_pnl = sum(r[\"net_credit\"] * 0.8 if r[\"win_rate\"] > 60 else -r[\"max_loss\"] * 0.2 \n                    for r in results)\n    \n    wins = [r for r in results if r[\"net_credit\"] > 0]\n    losses = [r for r in results if r[\"net_credit\"] <= 0]\n    \n    return {\n        \"strategy\": strategy, \"symbol\": symbol,\n        \"total_pnl_estimate\": round(total_pnl, 2),\n        \"avg_win_rate\": round(np.mean([r[\"win_rate\"] for r in results]), 1),\n        \"avg_sharpe\": round(np.mean([r[\"sharpe\"] for r in results]), 2),\n        \"max_drawdown\": round(min(r[\"max_dd\"] for r in results), 2),\n        \"win_count\": len(wins), \"loss_count\": len(losses),\n        \"edge\": round(np.mean([r[\"expectancy\"] for r in results]), 2)\n    }\n\nif __name__ == \"__main__\":\n    ap = argparse.ArgumentParser()\n    ap.add_argument(\"--strategy\", default=\"iron_condor\")\n    ap.add_argument(\"--symbol\", default=\"SPY\")\n    ap.add_argument(\"--iv\", type=float, default=0.30)\n    ap.add_argument(\"--days\", type=int, default=45)\n    ap.add_argument(\"--short-delta\", type=float, default=0.20)\n    ap.add_argument(\"--width\", type=float, default=5.0)\n    ap.add_argument(\"--output\", default=\"\")\n    args = ap.parse_args()\n    \n    result = run_backtest(args.strategy, args.symbol, args.iv, args.days, args.short_delta, args.width)\n    \n    print(f\"\\n{'='*55}\")\n    print(f\"  {result['strategy'].upper()} Backtest — {result['symbol']}\")\n    print(f\"{'='*55}\")\n    print(f\"  Win Rate:        {result['avg_win_rate']}%\")\n    print(f\"  Avg Sharpe:      {result['avg_sharpe']}\")\n    print(f\"  Max Drawdown:   ${result['max_drawdown']}\")\n    print(f\"  Win/Loss:        {result['win_count']}W / {result['loss_count']}L\")\n    print(f\"  Expectancy:     ${result['edge']}/trade\")\n    print(f\"  Est. Total P&L: ${result['total_pnl_estimate']}\")\n    print(f\"{'='*55}\")\n    \n    if args.output:\n        with open(args.output, \"w\") as f:\n            json.dump(result, f, indent=2, default=str)\n        print(f\"\\nResults saved to {args.output}\")\n```\n\n## Usage\n\n```bash\n# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10\n```\n\n## Default Config (config/strategies.json)\n\n```json\n{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}\n```\n\n## Error Handling\n\n- If IV < 20%, reject the trade (low IV = poor premium)\n- If bid-ask spread > $0.50, reject the trade\n- If days to expiration < 14, skip (too close to gamma crush)\n- Commission: $0.65/contract (4 legs = $2.60 per round trip)\n\nFile v1.0.18:_meta.json\n\n{\n  \"ownerId\": \"kn723dy43mmbqpy0cp62hwptm984gga5\",\n  \"slug\": \"options-trading-backtester\",\n  \"version\": \"1.0.18\",\n  \"publishedAt\": 1782136975396\n}\n\nFile v1.0.18:skill-card.md\n\n## Description:\n\nBuilds Python options strategy backtesting simulations for iron condors, strangles, calendar spreads, and vertical credit spreads, with outputs such as win rate, Sharpe ratio, drawdown, expectancy, and equity curve.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[ssidharhubble](https://clawhub.ai/user/ssidharhubble)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and analysts use this skill to draft and run Python-based options strategy simulations, test parameters, and summarize synthetic backtest-style metrics. Outputs should be reviewed before being used for trading decisions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Users may mistake simplified or synthetic options backtest outputs for realistic historical trading evidence or investment advice.\n\nMitigation: Treat outputs as synthetic simulations unless real data ingestion, strategy logic, risk filters, and financial disclaimers are independently reviewed and implemented.\n\n## Reference(s):\n\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration]\n\n**Output Format:** [Markdown with Python, bash, and JSON snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May produce synthetic options backtest metrics and optional JSON result files when an output path is configured.]\n\n## Skill Version(s):\n\n1.0.18 (source: frontmatter and server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.17: 3 files, 4110 bytes\n\nFiles: skill-card.md (1935b), SKILL.md (7289b), _meta.json (146b)\n\nFile v1.0.17:SKILL.md\n\n---\nname: options-trading-backtester\nversion: 1.0.17\ndescription: |\n  Build and run options strategy backtests in Python. Supports Iron Condor, Strangle,\n  Calendar Spread, Vertical Credit Spread. Tests against historical data with realistic\n  slippage, commission ($0.65/contract), and IV crush modeling. Outputs Sharpe ratio,\n  win rate, max drawdown, expectancy, and equity curve. Use when user asks to backtest\n  an options strategy, test a config, or analyze trade history.\ncompatibility: Python 3.10+, pandas, numpy, scipy, matplotlib. Optional: yfinance (free data).\nmetadata:\n  author: ssyopro.zo.computer\n  category: finance\n  display-name: Options Trading Backtester\n  tags: options, backtesting, trading-strategy, python, quant-finance, iron-condor, strangle\n---\n\n# Options Trading Backtester\n\nEvent-driven backtester for options strategies. Tests against synthetic or real historical data.\n\n## Strategy Types\n\n| Strategy | Description | Best For |\n|---|---|---|\n| Iron Condor | Sell OTM put spread + OTM call spread | Neutral markets, high IV |\n| Strangle | Sell OTM put + OTM call, same expiration | Low-cost setup, volatile markets |\n| Calendar Spread | Buy long-dated, sell short-dated same strike | Time decay, mean reversion |\n| Vertical Credit Spread | Bull put or Bear call spread | Directional trades with defined risk |\n\n## Backtest Engine\n\n```python\n#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\": round(width * 100, 2),\n        \"win_rate\": round((pnl_arr > 0).mean() * 100, 1),\n        \"avg_win\": round(pnl_arr[pnl_arr > 0].mean(), 2) if (pnl_arr > 0).any() else 0,\n        \"avg_loss\": round(pnl_arr[pnl_arr < 0].mean(), 2) if (pnl_arr < 0).any() else 0,\n        \"sharpe\": round(pnl_arr.mean() / (pnl_arr.std() + 1e-9), 2),\n        \"max_dd\": round(pnl_arr.min(), 2),\n        \"expectancy\": round((pnl_arr > 0).mean() * pnl_arr[pnl_arr > 0].mean() - \n                           (pnl_arr < 0).mean() * abs(pnl_arr[pnl_arr < 0].mean()), 2),\n        \"sample_size\": len(outcomes)\n    }\n\ndef run_backtest(strategy: str, symbol: str = \"SPY\", iv: float = 0.30, \n                 days: int = 45, short_delta: float = 0.20, width: float = 5.0):\n    results = []\n    for _ in range(20):  # 20 simulated entry points\n        price = np.random.uniform(400, 500)\n        r = simulate_iron_condor(price, iv, days, short_delta, width)\n        results.append(r)\n    \n    total_pnl = sum(r[\"net_credit\"] * 0.8 if r[\"win_rate\"] > 60 else -r[\"max_loss\"] * 0.2 \n                    for r in results)\n    \n    wins = [r for r in results if r[\"net_credit\"] > 0]\n    losses = [r for r in results if r[\"net_credit\"] <= 0]\n    \n    return {\n        \"strategy\": strategy, \"symbol\": symbol,\n        \"total_pnl_estimate\": round(total_pnl, 2),\n        \"avg_win_rate\": round(np.mean([r[\"win_rate\"] for r in results]), 1),\n        \"avg_sharpe\": round(np.mean([r[\"sharpe\"] for r in results]), 2),\n        \"max_drawdown\": round(min(r[\"max_dd\"] for r in results), 2),\n        \"win_count\": len(wins), \"loss_count\": len(losses),\n        \"edge\": round(np.mean([r[\"expectancy\"] for r in results]), 2)\n    }\n\nif __name__ == \"__main__\":\n    ap = argparse.ArgumentParser()\n    ap.add_argument(\"--strategy\", default=\"iron_condor\")\n    ap.add_argument(\"--symbol\", default=\"SPY\")\n    ap.add_argument(\"--iv\", type=float, default=0.30)\n    ap.add_argument(\"--days\", type=int, default=45)\n    ap.add_argument(\"--short-delta\", type=float, default=0.20)\n    ap.add_argument(\"--width\", type=float, default=5.0)\n    ap.add_argument(\"--output\", default=\"\")\n    args = ap.parse_args()\n    \n    result = run_backtest(args.strategy, args.symbol, args.iv, args.days, args.short_delta, args.width)\n    \n    print(f\"\\n{'='*55}\")\n    print(f\"  {result['strategy'].upper()} Backtest — {result['symbol']}\")\n    print(f\"{'='*55}\")\n    print(f\"  Win Rate:        {result['avg_win_rate']}%\")\n    print(f\"  Avg Sharpe:      {result['avg_sharpe']}\")\n    print(f\"  Max Drawdown:   ${result['max_drawdown']}\")\n    print(f\"  Win/Loss:        {result['win_count']}W / {result['loss_count']}L\")\n    print(f\"  Expectancy:     ${result['edge']}/trade\")\n    print(f\"  Est. Total P&L: ${result['total_pnl_estimate']}\")\n    print(f\"{'='*55}\")\n    \n    if args.output:\n        with open(args.output, \"w\") as f:\n            json.dump(result, f, indent=2, default=str)\n        print(f\"\\nResults saved to {args.output}\")\n```\n\n## Usage\n\n```bash\n# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10\n```\n\n## Default Config (config/strategies.json)\n\n```json\n{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}\n```\n\n## Error Handling\n\n- If IV < 20%, reject the trade (low IV = poor premium)\n- If bid-ask spread > $0.50, reject the trade\n- If days to expiration < 14, skip (too close to gamma crush)\n- Commission: $0.65/contract (4 legs = $2.60 per round trip)\n\nFile v1.0.17:_meta.json\n\n{\n  \"ownerId\": \"kn723dy43mmbqpy0cp62hwptm984gga5\",\n  \"slug\": \"options-trading-backtester\",\n  \"version\": \"1.0.17\",\n  \"publishedAt\": 1782136460923\n}\n\nFile v1.0.17:skill-card.md\n\n## Description: <br>\nBuild and run options strategy backtests in Python for strategies such as iron condors, strangles, calendar spreads, and vertical credit spreads. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[ssidharhubble](https://clawhub.ai/user/ssidharhubble) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and trading-tool builders can use this skill to draft Python backtesting code, example commands, and configuration for options strategy experiments. Its outputs should be treated as a starting template, not as validated trading advice. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill may overstate its options backtesting capabilities and produce misleading trading analysis. <br>\nMitigation: Treat outputs as a toy example or starting template; do not use them for trading decisions without real data handling, strategy-specific validation, and documented risk controls. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/ssidharhubble/options-trading-backtester) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown with Python, bash, and JSON code blocks] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include simulated backtest metrics and file-output examples; users should validate assumptions, data handling, and risk controls before relying on results.] <br>\n\n## Skill Version(s): <br>\n1.0.17 (source: evidence release and SKILL.md frontmatter) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.16: 3 files, 4092 bytes\n\nFiles: skill-card.md (1905b), SKILL.md (7289b), _meta.json (146b)\n\nFile v1.0.16:SKILL.md\n\n---\nname: options-trading-backtester\nversion: 1.0.16\ndescription: |\n  Build and run options strategy backtests in Python. Supports Iron Condor, Strangle,\n  Calendar Spread, Vertical Credit Spread. Tests against historical data with realistic\n  slippage, commission ($0.65/contract), and IV crush modeling. Outputs Sharpe ratio,\n  win rate, max drawdown, expectancy, and equity curve. Use when user asks to backtest\n  an options strategy, test a config, or analyze trade history.\ncompatibility: Python 3.10+, pandas, numpy, scipy, matplotlib. Optional: yfinance (free data).\nmetadata:\n  author: ssyopro.zo.computer\n  category: finance\n  display-name: Options Trading Backtester\n  tags: options, backtesting, trading-strategy, python, quant-finance, iron-condor, strangle\n---\n\n# Options Trading Backtester\n\nEvent-driven backtester for options strategies. Tests against synthetic or real historical data.\n\n## Strategy Types\n\n| Strategy | Description | Best For |\n|---|---|---|\n| Iron Condor | Sell OTM put spread + OTM call spread | Neutral markets, high IV |\n| Strangle | Sell OTM put + OTM call, same expiration | Low-cost setup, volatile markets |\n| Calendar Spread | Buy long-dated, sell short-dated same strike | Time decay, mean reversion |\n| Vertical Credit Spread | Bull put or Bear call spread | Directional trades with defined risk |\n\n## Backtest Engine\n\n```python\n#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\": round(width * 100, 2),\n        \"win_rate\": round((pnl_arr > 0).mean() * 100, 1),\n        \"avg_win\": round(pnl_arr[pnl_arr > 0].mean(), 2) if (pnl_arr > 0).any() else 0,\n        \"avg_loss\": round(pnl_arr[pnl_arr < 0].mean(), 2) if (pnl_arr < 0).any() else 0,\n        \"sharpe\": round(pnl_arr.mean() / (pnl_arr.std() + 1e-9), 2),\n        \"max_dd\": round(pnl_arr.min(), 2),\n        \"expectancy\": round((pnl_arr > 0).mean() * pnl_arr[pnl_arr > 0].mean() - \n                           (pnl_arr < 0).mean() * abs(pnl_arr[pnl_arr < 0].mean()), 2),\n        \"sample_size\": len(outcomes)\n    }\n\ndef run_backtest(strategy: str, symbol: str = \"SPY\", iv: float = 0.30, \n                 days: int = 45, short_delta: float = 0.20, width: float = 5.0):\n    results = []\n    for _ in range(20):  # 20 simulated entry points\n        price = np.random.uniform(400, 500)\n        r = simulate_iron_condor(price, iv, days, short_delta, width)\n        results.append(r)\n    \n    total_pnl = sum(r[\"net_credit\"] * 0.8 if r[\"win_rate\"] > 60 else -r[\"max_loss\"] * 0.2 \n                    for r in results)\n    \n    wins = [r for r in results if r[\"net_credit\"] > 0]\n    losses = [r for r in results if r[\"net_credit\"] <= 0]\n    \n    return {\n        \"strategy\": strategy, \"symbol\": symbol,\n        \"total_pnl_estimate\": round(total_pnl, 2),\n        \"avg_win_rate\": round(np.mean([r[\"win_rate\"] for r in results]), 1),\n        \"avg_sharpe\": round(np.mean([r[\"sharpe\"] for r in results]), 2),\n        \"max_drawdown\": round(min(r[\"max_dd\"] for r in results), 2),\n        \"win_count\": len(wins), \"loss_count\": len(losses),\n        \"edge\": round(np.mean([r[\"expectancy\"] for r in results]), 2)\n    }\n\nif __name__ == \"__main__\":\n    ap = argparse.ArgumentParser()\n    ap.add_argument(\"--strategy\", default=\"iron_condor\")\n    ap.add_argument(\"--symbol\", default=\"SPY\")\n    ap.add_argument(\"--iv\", type=float, default=0.30)\n    ap.add_argument(\"--days\", type=int, default=45)\n    ap.add_argument(\"--short-delta\", type=float, default=0.20)\n    ap.add_argument(\"--width\", type=float, default=5.0)\n    ap.add_argument(\"--output\", default=\"\")\n    args = ap.parse_args()\n    \n    result = run_backtest(args.strategy, args.symbol, args.iv, args.days, args.short_delta, args.width)\n    \n    print(f\"\\n{'='*55}\")\n    print(f\"  {result['strategy'].upper()} Backtest — {result['symbol']}\")\n    print(f\"{'='*55}\")\n    print(f\"  Win Rate:        {result['avg_win_rate']}%\")\n    print(f\"  Avg Sharpe:      {result['avg_sharpe']}\")\n    print(f\"  Max Drawdown:   ${result['max_drawdown']}\")\n    print(f\"  Win/Loss:        {result['win_count']}W / {result['loss_count']}L\")\n    print(f\"  Expectancy:     ${result['edge']}/trade\")\n    print(f\"  Est. Total P&L: ${result['total_pnl_estimate']}\")\n    print(f\"{'='*55}\")\n    \n    if args.output:\n        with open(args.output, \"w\") as f:\n            json.dump(result, f, indent=2, default=str)\n        print(f\"\\nResults saved to {args.output}\")\n```\n\n## Usage\n\n```bash\n# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10\n```\n\n## Default Config (config/strategies.json)\n\n```json\n{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}\n```\n\n## Error Handling\n\n- If IV < 20%, reject the trade (low IV = poor premium)\n- If bid-ask spread > $0.50, reject the trade\n- If days to expiration < 14, skip (too close to gamma crush)\n- Commission: $0.65/contract (4 legs = $2.60 per round trip)\n\nFile v1.0.16:_meta.json\n\n{\n  \"ownerId\": \"kn723dy43mmbqpy0cp62hwptm984gga5\",\n  \"slug\": \"options-trading-backtester\",\n  \"version\": \"1.0.16\",\n  \"publishedAt\": 1782133849726\n}\n\nFile v1.0.16:skill-card.md\n\n## Description: <br>\nHelps build and run Python options strategy backtests for strategies such as iron condors, strangles, calendar spreads, and vertical credit spreads, with reported metrics including Sharpe ratio, win rate, max drawdown, expectancy, and equity curve. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[ssidharhubble](https://clawhub.ai/user/ssidharhubble) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, analysts, and finance users can use this skill to scaffold and run Python backtests for options strategies, test strategy configurations, or analyze trade-history scenarios before manual review. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Financial-analysis behavior may produce misleading strategy or risk results due to documentation-to-behavior mismatches. <br>\nMitigation: Do not rely on the skill for trading decisions; independently review calculations, confirm strategy selection behavior, and require tests for each advertised strategy and risk control before use. <br>\n\n\n## Reference(s): <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown with Python, JSON, and shell command snippets] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May describe generated backtest metrics such as Sharpe ratio, win rate, max drawdown, expectancy, and equity curve.] <br>\n\n## Skill Version(s): <br>\n1.0.16 (source: frontmatter and server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.15: 3 files, 4257 bytes\n\nFiles: skill-card.md (2244b), SKILL.md (7289b), _meta.json (146b)\n\nFile v1.0.15:SKILL.md\n\n---\nname: options-trading-backtester\nversion: 1.0.15\ndescription: |\n  Build and run options strategy backtests in Python. Supports Iron Condor, Strangle,\n  Calendar Spread, Vertical Credit Spread. Tests against historical data with realistic\n  slippage, commission ($0.65/contract), and IV crush modeling. Outputs Sharpe ratio,\n  win rate, max drawdown, expectancy, and equity curve. Use when user asks to backtest\n  an options strategy, test a config, or analyze trade history.\ncompatibility: Python 3.10+, pandas, numpy, scipy, matplotlib. Optional: yfinance (free data).\nmetadata:\n  author: ssyopro.zo.computer\n  category: finance\n  display-name: Options Trading Backtester\n  tags: options, backtesting, trading-strategy, python, quant-finance, iron-condor, strangle\n---\n\n# Options Trading Backtester\n\nEvent-driven backtester for options strategies. Tests against synthetic or real historical data.\n\n## Strategy Types\n\n| Strategy | Description | Best For |\n|---|---|---|\n| Iron Condor | Sell OTM put spread + OTM call spread | Neutral markets, high IV |\n| Strangle | Sell OTM put + OTM call, same expiration | Low-cost setup, volatile markets |\n| Calendar Spread | Buy long-dated, sell short-dated same strike | Time decay, mean reversion |\n| Vertical Credit Spread | Bull put or Bear call spread | Directional trades with defined risk |\n\n## Backtest Engine\n\n```python\n#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\": round(width * 100, 2),\n        \"win_rate\": round((pnl_arr > 0).mean() * 100, 1),\n        \"avg_win\": round(pnl_arr[pnl_arr > 0].mean(), 2) if (pnl_arr > 0).any() else 0,\n        \"avg_loss\": round(pnl_arr[pnl_arr < 0].mean(), 2) if (pnl_arr < 0).any() else 0,\n        \"sharpe\": round(pnl_arr.mean() / (pnl_arr.std() + 1e-9), 2),\n        \"max_dd\": round(pnl_arr.min(), 2),\n        \"expectancy\": round((pnl_arr > 0).mean() * pnl_arr[pnl_arr > 0].mean() - \n                           (pnl_arr < 0).mean() * abs(pnl_arr[pnl_arr < 0].mean()), 2),\n        \"sample_size\": len(outcomes)\n    }\n\ndef run_backtest(strategy: str, symbol: str = \"SPY\", iv: float = 0.30, \n                 days: int = 45, short_delta: float = 0.20, width: float = 5.0):\n    results = []\n    for _ in range(20):  # 20 simulated entry points\n        price = np.random.uniform(400, 500)\n        r = simulate_iron_condor(price, iv, days, short_delta, width)\n        results.append(r)\n    \n    total_pnl = sum(r[\"net_credit\"] * 0.8 if r[\"win_rate\"] > 60 else -r[\"max_loss\"] * 0.2 \n                    for r in results)\n    \n    wins = [r for r in results if r[\"net_credit\"] > 0]\n    losses = [r for r in results if r[\"net_credit\"] <= 0]\n    \n    return {\n        \"strategy\": strategy, \"symbol\": symbol,\n        \"total_pnl_estimate\": round(total_pnl, 2),\n        \"avg_win_rate\": round(np.mean([r[\"win_rate\"] for r in results]), 1),\n        \"avg_sharpe\": round(np.mean([r[\"sharpe\"] for r in results]), 2),\n        \"max_drawdown\": round(min(r[\"max_dd\"] for r in results), 2),\n        \"win_count\": len(wins), \"loss_count\": len(losses),\n        \"edge\": round(np.mean([r[\"expectancy\"] for r in results]), 2)\n    }\n\nif __name__ == \"__main__\":\n    ap = argparse.ArgumentParser()\n    ap.add_argument(\"--strategy\", default=\"iron_condor\")\n    ap.add_argument(\"--symbol\", default=\"SPY\")\n    ap.add_argument(\"--iv\", type=float, default=0.30)\n    ap.add_argument(\"--days\", type=int, default=45)\n    ap.add_argument(\"--short-delta\", type=float, default=0.20)\n    ap.add_argument(\"--width\", type=float, default=5.0)\n    ap.add_argument(\"--output\", default=\"\")\n    args = ap.parse_args()\n    \n    result = run_backtest(args.strategy, args.symbol, args.iv, args.days, args.short_delta, args.width)\n    \n    print(f\"\\n{'='*55}\")\n    print(f\"  {result['strategy'].upper()} Backtest — {result['symbol']}\")\n    print(f\"{'='*55}\")\n    print(f\"  Win Rate:        {result['avg_win_rate']}%\")\n    print(f\"  Avg Sharpe:      {result['avg_sharpe']}\")\n    print(f\"  Max Drawdown:   ${result['max_drawdown']}\")\n    print(f\"  Win/Loss:        {result['win_count']}W / {result['loss_count']}L\")\n    print(f\"  Expectancy:     ${result['edge']}/trade\")\n    print(f\"  Est. Total P&L: ${result['total_pnl_estimate']}\")\n    print(f\"{'='*55}\")\n    \n    if args.output:\n        with open(args.output, \"w\") as f:\n            json.dump(result, f, indent=2, default=str)\n        print(f\"\\nResults saved to {args.output}\")\n```\n\n## Usage\n\n```bash\n# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10\n```\n\n## Default Config (config/strategies.json)\n\n```json\n{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}\n```\n\n## Error Handling\n\n- If IV < 20%, reject the trade (low IV = poor premium)\n- If bid-ask spread > $0.50, reject the trade\n- If days to expiration < 14, skip (too close to gamma crush)\n- Commission: $0.65/contract (4 legs = $2.60 per round trip)\n\nFile v1.0.15:_meta.json\n\n{\n  \"ownerId\": \"kn723dy43mmbqpy0cp62hwptm984gga5\",\n  \"slug\": \"options-trading-backtester\",\n  \"version\": \"1.0.15\",\n  \"publishedAt\": 1780665258229\n}\n\nFile v1.0.15:skill-card.md\n\n## Description: <br>\nBuilds and runs Python options strategy backtests for strategies such as iron condors, strangles, calendar spreads, and vertical credit spreads, with reported metrics including Sharpe ratio, win rate, max drawdown, expectancy, and equity curve. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[ssidharhubble](https://clawhub.ai/user/ssidharhubble) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, quantitative analysts, and trading researchers use this skill to draft or run Python-based options backtest workflows and inspect simulated performance metrics. Outputs should be reviewed carefully before any trading or strategy-evaluation decision. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill may present randomized demo results as historical options backtesting, which could mislead users making trading decisions. <br>\nMitigation: Treat outputs as synthetic demonstrations unless the implementation is corrected to use validated market data, strategy-specific logic, and enforced risk filters. <br>\nRisk: Finance-related outputs may be mistaken for investment advice or reliable strategy-performance evidence. <br>\nMitigation: Require human review by qualified users before using outputs for trading, risk management, or strategy evaluation. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/ssidharhubble/options-trading-backtester) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown with Python, shell command, and JSON configuration examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include simulated performance metrics and optional JSON result files.] <br>\n\n## Skill Version(s): <br>\n1.0.15 (source: frontmatter and server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.14: 3 files, 4145 bytes\n\nFiles: skill-card.md (2057b), SKILL.md (7289b), _meta.json (146b)\n\nFile v1.0.14:SKILL.md\n\n---\nname: options-trading-backtester\nversion: 1.0.14\ndescription: |\n  Build and run options strategy backtests in Python. Supports Iron Condor, Strangle,\n  Calendar Spread, Vertical Credit Spread. Tests against historical data with realistic\n  slippage, commission ($0.65/contract), and IV crush modeling. Outputs Sharpe ratio,\n  win rate, max drawdown, expectancy, and equity curve. Use when user asks to backtest\n  an options strategy, test a config, or analyze trade history.\ncompatibility: Python 3.10+, pandas, numpy, scipy, matplotlib. Optional: yfinance (free data).\nmetadata:\n  author: ssyopro.zo.computer\n  category: finance\n  display-name: Options Trading Backtester\n  tags: options, backtesting, trading-strategy, python, quant-finance, iron-condor, strangle\n---\n\n# Options Trading Backtester\n\nEvent-driven backtester for options strategies. Tests against synthetic or real historical data.\n\n## Strategy Types\n\n| Strategy | Description | Best For |\n|---|---|---|\n| Iron Condor | Sell OTM put spread + OTM call spread | Neutral markets, high IV |\n| Strangle | Sell OTM put + OTM call, same expiration | Low-cost setup, volatile markets |\n| Calendar Spread | Buy long-dated, sell short-dated same strike | Time decay, mean reversion |\n| Vertical Credit Spread | Bull put or Bear call spread | Directional trades with defined risk |\n\n## Backtest Engine\n\n```python\n#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\": round(width * 100, 2),\n        \"win_rate\": round((pnl_arr > 0).mean() * 100, 1),\n        \"avg_win\": round(pnl_arr[pnl_arr > 0].mean(), 2) if (pnl_arr > 0).any() else 0,\n        \"avg_loss\": round(pnl_arr[pnl_arr < 0].mean(), 2) if (pnl_arr < 0).any() else 0,\n        \"sharpe\": round(pnl_arr.mean() / (pnl_arr.std() + 1e-9), 2),\n        \"max_dd\": round(pnl_arr.min(), 2),\n        \"expectancy\": round((pnl_arr > 0).mean() * pnl_arr[pnl_arr > 0].mean() - \n                           (pnl_arr < 0).mean() * abs(pnl_arr[pnl_arr < 0].mean()), 2),\n        \"sample_size\": len(outcomes)\n    }\n\ndef run_backtest(strategy: str, symbol: str = \"SPY\", iv: float = 0.30, \n                 days: int = 45, short_delta: float = 0.20, width: float = 5.0):\n    results = []\n    for _ in range(20):  # 20 simulated entry points\n        price = np.random.uniform(400, 500)\n        r = simulate_iron_condor(price, iv, days, short_delta, width)\n        results.append(r)\n    \n    total_pnl = sum(r[\"net_credit\"] * 0.8 if r[\"win_rate\"] > 60 else -r[\"max_loss\"] * 0.2 \n                    for r in results)\n    \n    wins = [r for r in results if r[\"net_credit\"] > 0]\n    losses = [r for r in results if r[\"net_credit\"] <= 0]\n    \n    return {\n        \"strategy\": strategy, \"symbol\": symbol,\n        \"total_pnl_estimate\": round(total_pnl, 2),\n        \"avg_win_rate\": round(np.mean([r[\"win_rate\"] for r in results]), 1),\n        \"avg_sharpe\": round(np.mean([r[\"sharpe\"] for r in results]), 2),\n        \"max_drawdown\": round(min(r[\"max_dd\"] for r in results), 2),\n        \"win_count\": len(wins), \"loss_count\": len(losses),\n        \"edge\": round(np.mean([r[\"expectancy\"] for r in results]), 2)\n    }\n\nif __name__ == \"__main__\":\n    ap = argparse.ArgumentParser()\n    ap.add_argument(\"--strategy\", default=\"iron_condor\")\n    ap.add_argument(\"--symbol\", default=\"SPY\")\n    ap.add_argument(\"--iv\", type=float, default=0.30)\n    ap.add_argument(\"--days\", type=int, default=45)\n    ap.add_argument(\"--short-delta\", type=float, default=0.20)\n    ap.add_argument(\"--width\", type=float, default=5.0)\n    ap.add_argument(\"--output\", default=\"\")\n    args = ap.parse_args()\n    \n    result = run_backtest(args.strategy, args.symbol, args.iv, args.days, args.short_delta, args.width)\n    \n    print(f\"\\n{'='*55}\")\n    print(f\"  {result['strategy'].upper()} Backtest — {result['symbol']}\")\n    print(f\"{'='*55}\")\n    print(f\"  Win Rate:        {result['avg_win_rate']}%\")\n    print(f\"  Avg Sharpe:      {result['avg_sharpe']}\")\n    print(f\"  Max Drawdown:   ${result['max_drawdown']}\")\n    print(f\"  Win/Loss:        {result['win_count']}W / {result['loss_count']}L\")\n    print(f\"  Expectancy:     ${result['edge']}/trade\")\n    print(f\"  Est. Total P&L: ${result['total_pnl_estimate']}\")\n    print(f\"{'='*55}\")\n    \n    if args.output:\n        with open(args.output, \"w\") as f:\n            json.dump(result, f, indent=2, default=str)\n        print(f\"\\nResults saved to {args.output}\")\n```\n\n## Usage\n\n```bash\n# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10\n```\n\n## Default Config (config/strategies.json)\n\n```json\n{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}\n```\n\n## Error Handling\n\n- If IV < 20%, reject the trade (low IV = poor premium)\n- If bid-ask spread > $0.50, reject the trade\n- If days to expiration < 14, skip (too close to gamma crush)\n- Commission: $0.65/contract (4 legs = $2.60 per round trip)\n\nFile v1.0.14:_meta.json\n\n{\n  \"ownerId\": \"kn723dy43mmbqpy0cp62hwptm984gga5\",\n  \"slug\": \"options-trading-backtester\",\n  \"version\": \"1.0.14\",\n  \"publishedAt\": 1779023530229\n}\n\nFile v1.0.14:skill-card.md\n\n## Description: <br>\nBuilds and runs Python options strategy backtests for strategies such as iron condors, strangles, calendar spreads, and vertical credit spreads. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[ssidharhubble](https://clawhub.ai/user/ssidharhubble) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users and developers can use this skill to generate Python backtesting code, configuration examples, and summary metrics for options strategy experiments. Outputs should be treated as toy synthetic simulations rather than reliable historical backtests or trading guidance. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill may produce outputs that look like realistic financial backtests while relying on toy synthetic simulations. <br>\nMitigation: Review methodology and assumptions before use, and do not rely on outputs as trading advice or as validated historical performance. <br>\nRisk: Generated strategy metrics may overstate reliability for real options trading decisions. <br>\nMitigation: Validate any generated code, data source, assumptions, and risk controls with qualified financial review before applying results. <br>\n\n\n## Reference(s): <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown with Python, JSON, and shell command examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include simulated strategy metrics such as win rate, Sharpe ratio, max drawdown, expectancy, and estimated P&L.] <br>\n\n## Skill Version(s): <br>\n1.0.14 (source: frontmatter and server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.13: 2 files, 3047 bytes\n\nFiles: SKILL.md (7289b), _meta.json (146b)\n\nFile v1.0.13:SKILL.md\n\n---\nname: options-trading-backtester\nversion: 1.0.13\ndescription: |\n  Build and run options strategy backtests in Python. Supports Iron Condor, Strangle,\n  Calendar Spread, Vertical Credit Spread. Tests against historical data with realistic\n  slippage, commission ($0.65/contract), and IV crush modeling. Outputs Sharpe ratio,\n  win rate, max drawdown, expectancy, and equity curve. Use when user asks to backtest\n  an options strategy, test a config, or analyze trade history.\ncompatibility: Python 3.10+, pandas, numpy, scipy, matplotlib. Optional: yfinance (free data).\nmetadata:\n  author: ssyopro.zo.computer\n  category: finance\n  display-name: Options Trading Backtester\n  tags: options, backtesting, trading-strategy, python, quant-finance, iron-condor, strangle\n---\n\n# Options Trading Backtester\n\nEvent-driven backtester for options strategies. Tests against synthetic or real historical data.\n\n## Strategy Types\n\n| Strategy | Description | Best For |\n|---|---|---|\n| Iron Condor | Sell OTM put spread + OTM call spread | Neutral markets, high IV |\n| Strangle | Sell OTM put + OTM call, same expiration | Low-cost setup, volatile markets |\n| Calendar Spread | Buy long-dated, sell short-dated same strike | Time decay, mean reversion |\n| Vertical Credit Spread | Bull put or Bear call spread | Directional trades with defined risk |\n\n## Backtest Engine\n\n```python\n#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\": round(width * 100, 2),\n        \"win_rate\": round((pnl_arr > 0).mean() * 100, 1),\n        \"avg_win\": round(pnl_arr[pnl_arr > 0].mean(), 2) if (pnl_arr > 0).any() else 0,\n        \"avg_loss\": round(pnl_arr[pnl_arr < 0].mean(), 2) if (pnl_arr < 0).any() else 0,\n        \"sharpe\": round(pnl_arr.mean() / (pnl_arr.std() + 1e-9), 2),\n        \"max_dd\": round(pnl_arr.min(), 2),\n        \"expectancy\": round((pnl_arr > 0).mean() * pnl_arr[pnl_arr > 0].mean() - \n                           (pnl_arr < 0).mean() * abs(pnl_arr[pnl_arr < 0].mean()), 2),\n        \"sample_size\": len(outcomes)\n    }\n\ndef run_backtest(strategy: str, symbol: str = \"SPY\", iv: float = 0.30, \n                 days: int = 45, short_delta: float = 0.20, width: float = 5.0):\n    results = []\n    for _ in range(20):  # 20 simulated entry points\n        price = np.random.uniform(400, 500)\n        r = simulate_iron_condor(price, iv, days, short_delta, width)\n        results.append(r)\n    \n    total_pnl = sum(r[\"net_credit\"] * 0.8 if r[\"win_rate\"] > 60 else -r[\"max_loss\"] * 0.2 \n                    for r in results)\n    \n    wins = [r for r in results if r[\"net_credit\"] > 0]\n    losses = [r for r in results if r[\"net_credit\"] <= 0]\n    \n    return {\n        \"strategy\": strategy, \"symbol\": symbol,\n        \"total_pnl_estimate\": round(total_pnl, 2),\n        \"avg_win_rate\": round(np.mean([r[\"win_rate\"] for r in results]), 1),\n        \"avg_sharpe\": round(np.mean([r[\"sharpe\"] for r in results]), 2),\n        \"max_drawdown\": round(min(r[\"max_dd\"] for r in results), 2),\n        \"win_count\": len(wins), \"loss_count\": len(losses),\n        \"edge\": round(np.mean([r[\"expectancy\"] for r in results]), 2)\n    }\n\nif __name__ == \"__main__\":\n    ap = argparse.ArgumentParser()\n    ap.add_argument(\"--strategy\", default=\"iron_condor\")\n    ap.add_argument(\"--symbol\", default=\"SPY\")\n    ap.add_argument(\"--iv\", type=float, default=0.30)\n    ap.add_argument(\"--days\", type=int, default=45)\n    ap.add_argument(\"--short-delta\", type=float, default=0.20)\n    ap.add_argument(\"--width\", type=float, default=5.0)\n    ap.add_argument(\"--output\", default=\"\")\n    args = ap.parse_args()\n    \n    result = run_backtest(args.strategy, args.symbol, args.iv, args.days, args.short_delta, args.width)\n    \n    print(f\"\\n{'='*55}\")\n    print(f\"  {result['strategy'].upper()} Backtest — {result['symbol']}\")\n    print(f\"{'='*55}\")\n    print(f\"  Win Rate:        {result['avg_win_rate']}%\")\n    print(f\"  Avg Sharpe:      {result['avg_sharpe']}\")\n    print(f\"  Max Drawdown:   ${result['max_drawdown']}\")\n    print(f\"  Win/Loss:        {result['win_count']}W / {result['loss_count']}L\")\n    print(f\"  Expectancy:     ${result['edge']}/trade\")\n    print(f\"  Est. Total P&L: ${result['total_pnl_estimate']}\")\n    print(f\"{'='*55}\")\n    \n    if args.output:\n        with open(args.output, \"w\") as f:\n            json.dump(result, f, indent=2, default=str)\n        print(f\"\\nResults saved to {args.output}\")\n```\n\n## Usage\n\n```bash\n# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10\n```\n\n## Default Config (config/strategies.json)\n\n```json\n{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}\n```\n\n## Error Handling\n\n- If IV < 20%, reject the trade (low IV = poor premium)\n- If bid-ask spread > $0.50, reject the trade\n- If days to expiration < 14, skip (too close to gamma crush)\n- Commission: $0.65/contract (4 legs = $2.60 per round trip)\n\nFile v1.0.13:_meta.json\n\n{\n  \"ownerId\": \"kn723dy43mmbqpy0cp62hwptm984gga5\",\n  \"slug\": \"options-trading-backtester\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1778937255616\n}\n\nArchive v1.0.12: 2 files, 3047 bytes\n\nFiles: SKILL.md (7289b), _meta.json (146b)\n\nFile v1.0.12:SKILL.md\n\n---\nname: options-trading-backtester\nversion: 1.0.12\ndescription: |\n  Build and run options strategy backtests in Python. Supports Iron Condor, Strangle,\n  Calendar Spread, Vertical Credit Spread. Tests against historical data with realistic\n  slippage, commission ($0.65/contract), and IV crush modeling. Outputs Sharpe ratio,\n  win rate, max drawdown, expectancy, and equity curve. Use when user asks to backtest\n  an options strategy, test a config, or analyze trade history.\ncompatibility: Python 3.10+, pandas, numpy, scipy, matplotlib. Optional: yfinance (free data).\nmetadata:\n  author: ssyopro.zo.computer\n  category: finance\n  display-name: Options Trading Backtester\n  tags: options, backtesting, trading-strategy, python, quant-finance, iron-condor, strangle\n---\n\n# Options Trading Backtester\n\nEvent-driven backtester for options strategies. Tests against synthetic or real historical data.\n\n## Strategy Types\n\n| Strategy | Description | Best For |\n|---|---|---|\n| Iron Condor | Sell OTM put spread + OTM call spread | Neutral markets, high IV |\n| Strangle | Sell OTM put + OTM call, same expiration | Low-cost setup, volatile markets |\n| Calendar Spread | Buy long-dated, sell short-dated same strike | Time decay, mean reversion |\n| Vertical Credit Spread | Bull put or Bear call spread | Directional trades with defined risk |\n\n## Backtest Engine\n\n```python\n#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\": round(width * 100, 2),\n        \"win_rate\": round((pnl_arr > 0).mean() * 100, 1),\n        \"avg_win\": round(pnl_arr[pnl_arr > 0].mean(), 2) if (pnl_arr > 0).any() else 0,\n        \"avg_loss\": round(pnl_arr[pnl_arr < 0].mean(), 2) if (pnl_arr < 0).any() else 0,\n        \"sharpe\": round(pnl_arr.mean() / (pnl_arr.std() + 1e-9), 2),\n        \"max_dd\": round(pnl_arr.min(), 2),\n        \"expectancy\": round((pnl_arr > 0).mean() * pnl_arr[pnl_arr > 0].mean() - \n                           (pnl_arr < 0).mean() * abs(pnl_arr[pnl_arr < 0].mean()), 2),\n        \"sample_size\": len(outcomes)\n    }\n\ndef run_backtest(strategy: str, symbol: str = \"SPY\", iv: float = 0.30, \n                 days: int = 45, short_delta: float = 0.20, width: float = 5.0):\n    results = []\n    for _ in range(20):  # 20 simulated entry points\n        price = np.random.uniform(400, 500)\n        r = simulate_iron_condor(price, iv, days, short_delta, width)\n        results.append(r)\n    \n    total_pnl = sum(r[\"net_credit\"] * 0.8 if r[\"win_rate\"] > 60 else -r[\"max_loss\"] * 0.2 \n                    for r in results)\n    \n    wins = [r for r in results if r[\"net_credit\"] > 0]\n    losses = [r for r in results if r[\"net_credit\"] <= 0]\n    \n    return {\n        \"strategy\": strategy, \"symbol\": symbol,\n        \"total_pnl_estimate\": round(total_pnl, 2),\n        \"avg_win_rate\": round(np.mean([r[\"win_rate\"] for r in results]), 1),\n        \"avg_sharpe\": round(np.mean([r[\"sharpe\"] for r in results]), 2),\n        \"max_drawdown\": round(min(r[\"max_dd\"] for r in results), 2),\n        \"win_count\": len(wins), \"loss_count\": len(losses),\n        \"edge\": round(np.mean([r[\"expectancy\"] for r in results]), 2)\n    }\n\nif __name__ == \"__main__\":\n    ap = argparse.ArgumentParser()\n    ap.add_argument(\"--strategy\", default=\"iron_condor\")\n    ap.add_argument(\"--symbol\", default=\"SPY\")\n    ap.add_argument(\"--iv\", type=float, default=0.30)\n    ap.add_argument(\"--days\", type=int, default=45)\n    ap.add_argument(\"--short-delta\", type=float, default=0.20)\n    ap.add_argument(\"--width\", type=float, default=5.0)\n    ap.add_argument(\"--output\", default=\"\")\n    args = ap.parse_args()\n    \n    result = run_backtest(args.strategy, args.symbol, args.iv, args.days, args.short_delta, args.width)\n    \n    print(f\"\\n{'='*55}\")\n    print(f\"  {result['strategy'].upper()} Backtest — {result['symbol']}\")\n    print(f\"{'='*55}\")\n    print(f\"  Win Rate:        {result['avg_win_rate']}%\")\n    print(f\"  Avg Sharpe:      {result['avg_sharpe']}\")\n    print(f\"  Max Drawdown:   ${result['max_drawdown']}\")\n    print(f\"  Win/Loss:        {result['win_count']}W / {result['loss_count']}L\")\n    print(f\"  Expectancy:     ${result['edge']}/trade\")\n    print(f\"  Est. Total P&L: ${result['total_pnl_estimate']}\")\n    print(f\"{'='*55}\")\n    \n    if args.output:\n        with open(args.output, \"w\") as f:\n            json.dump(result, f, indent=2, default=str)\n        print(f\"\\nResults saved to {args.output}\")\n```\n\n## Usage\n\n```bash\n# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10\n```\n\n## Default Config (config/strategies.json)\n\n```json\n{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}\n```\n\n## Error Handling\n\n- If IV < 20%, reject the trade (low IV = poor premium)\n- If bid-ask spread > $0.50, reject the trade\n- If days to expiration < 14, skip (too close to gamma crush)\n- Commission: $0.65/contract (4 legs = $2.60 per round trip)\n\nFile v1.0.12:_meta.json\n\n{\n  \"ownerId\": \"kn723dy43mmbqpy0cp62hwptm984gga5\",\n  \"slug\": \"options-trading-backtester\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1778850658679\n}\n\nArchive v1.0.11: 2 files, 3047 bytes\n\nFiles: SKILL.md (7289b), _meta.json (146b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: options-trading-backtester\nversion: 1.0.11\ndescription: |\n  Build and run options strategy backtests in Python. Supports Iron Condor, Strangle,\n  Calendar Spread, Vertical Credit Spread. Tests against historical data with realistic\n  slippage, commission ($0.65/contract), and IV crush modeling. Outputs Sharpe ratio,\n  win rate, max drawdown, expectancy, and equity curve. Use when user asks to backtest\n  an options strategy, test a config, or analyze trade history.\ncompatibility: Python 3.10+, pandas, numpy, scipy, matplotlib. Optional: yfinance (free data).\nmetadata:\n  author: ssyopro.zo.computer\n  category: finance\n  display-name: Options Trading Backtester\n  tags: options, backtesting, trading-strategy, python, quant-finance, iron-condor, strangle\n---\n\n# Options Trading Backtester\n\nEvent-driven backtester for options strategies. Tests against synthetic or real historical data.\n\n## Strategy Types\n\n| Strategy | Description | Best For |\n|---|---|---|\n| Iron Condor | Sell OTM put spread + OTM call spread | Neutral markets, high IV |\n| Strangle | Sell OTM put + OTM call, same expiration | Low-cost setup, volatile markets |\n| Calendar Spread | Buy long-dated, sell short-dated same strike | Time decay, mean reversion |\n| Vertical Credit Spread | Bull put or Bear call spread | Directional trades with defined risk |\n\n## Backtest Engine\n\n```python\n#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\": round(width * 100, 2),\n        \"win_rate\": round((pnl_arr > 0).mean() * 100, 1),\n        \"avg_win\": round(pnl_arr[pnl_arr > 0].mean(), 2) if (pnl_arr > 0).any() else 0,\n        \"avg_loss\": round(pnl_arr[pnl_arr < 0].mean(), 2) if (pnl_arr < 0).any() else 0,\n        \"sharpe\": round(pnl_arr.mean() / (pnl_arr.std() + 1e-9), 2),\n        \"max_dd\": round(pnl_arr.min(), 2),\n        \"expectancy\": round((pnl_arr > 0).mean() * pnl_arr[pnl_arr > 0].mean() - \n                           (pnl_arr < 0).mean() * abs(pnl_arr[pnl_arr < 0].mean()), 2),\n        \"sample_size\": len(outcomes)\n    }\n\ndef run_backtest(strategy: str, symbol: str = \"SPY\", iv: float = 0.30, \n                 days: int = 45, short_delta: float = 0.20, width: float = 5.0):\n    results = []\n    for _ in range(20):  # 20 simulated entry points\n        price = np.random.uniform(400, 500)\n        r = simulate_iron_condor(price, iv, days, short_delta, width)\n        results.append(r)\n    \n    total_pnl = sum(r[\"net_credit\"] * 0.8 if r[\"win_rate\"] > 60 else -r[\"max_loss\"] * 0.2 \n                    for r in results)\n    \n    wins = [r for r in results if r[\"net_credit\"] > 0]\n    losses = [r for r in results if r[\"net_credit\"] <= 0]\n    \n    return {\n        \"strategy\": strategy, \"symbol\": symbol,\n        \"total_pnl_estimate\": round(total_pnl, 2),\n        \"avg_win_rate\": round(np.mean([r[\"win_rate\"] for r in results]), 1),\n        \"avg_sharpe\": round(np.mean([r[\"sharpe\"] for r in results]), 2),\n        \"max_drawdown\": round(min(r[\"max_dd\"] for r in results), 2),\n        \"win_count\": len(wins), \"loss_count\": len(losses),\n        \"edge\": round(np.mean([r[\"expectancy\"] for r in results]), 2)\n    }\n\nif __name__ == \"__main__\":\n    ap = argparse.ArgumentParser()\n    ap.add_argument(\"--strategy\", default=\"iron_condor\")\n    ap.add_argument(\"--symbol\", default=\"SPY\")\n    ap.add_argument(\"--iv\", type=float, default=0.30)\n    ap.add_argument(\"--days\", type=int, default=45)\n    ap.add_argument(\"--short-delta\", type=float, default=0.20)\n    ap.add_argument(\"--width\", type=float, default=5.0)\n    ap.add_argument(\"--output\", default=\"\")\n    args = ap.parse_args()\n    \n    result = run_backtest(args.strategy, args.symbol, args.iv, args.days, args.short_delta, args.width)\n    \n    print(f\"\\n{'='*55}\")\n    print(f\"  {result['strategy'].upper()} Backtest — {result['symbol']}\")\n    print(f\"{'='*55}\")\n    print(f\"  Win Rate:        {result['avg_win_rate']}%\")\n    print(f\"  Avg Sharpe:      {result['avg_sharpe']}\")\n    print(f\"  Max Drawdown:   ${result['max_drawdown']}\")\n    print(f\"  Win/Loss:        {result['win_count']}W / {result['loss_count']}L\")\n    print(f\"  Expectancy:     ${result['edge']}/trade\")\n    print(f\"  Est. Total P&L: ${result['total_pnl_estimate']}\")\n    print(f\"{'='*55}\")\n    \n    if args.output:\n        with open(args.output, \"w\") as f:\n            json.dump(result, f, indent=2, default=str)\n        print(f\"\\nResults saved to {args.output}\")\n```\n\n## Usage\n\n```bash\n# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10\n```\n\n## Default Config (config/strategies.json)\n\n```json\n{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}\n```\n\n## Error Handling\n\n- If IV < 20%, reject the trade (low IV = poor premium)\n- If bid-ask spread > $0.50, reject the trade\n- If days to expiration < 14, skip (too close to gamma crush)\n- Commission: $0.65/contract (4 legs = $2.60 per round trip)\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn723dy43mmbqpy0cp62hwptm984gga5\",\n  \"slug\": \"options-trading-backtester\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1778764312643\n}\n\nArchive v1.0.10: 2 files, 3046 bytes\n\nFiles: SKILL.md (7289b), _meta.json (146b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: options-trading-backtester\nversion: 1.0.10\ndescription: |\n  Build and run options strategy backtests in Python. Supports Iron Condor, Strangle,\n  Calendar Spread, Vertical Credit Spread. Tests against historical data with realistic\n  slippage, commission ($0.65/contract), and IV crush modeling. Outputs Sharpe ratio,\n  win rate, max drawdown, expectancy, and equity curve. Use when user asks to backtest\n  an options strategy, test a config, or analyze trade history.\ncompatibility: Python 3.10+, pandas, numpy, scipy, matplotlib. Optional: yfinance (free data).\nmetadata:\n  author: ssyopro.zo.computer\n  category: finance\n  display-name: Options Trading Backtester\n  tags: options, backtesting, trading-strategy, python, quant-finance, iron-condor, strangle\n---\n\n# Options Trading Backtester\n\nEvent-driven backtester for options strategies. Tests against synthetic or real historical data.\n\n## Strategy Types\n\n| Strategy | Description | Best For |\n|---|---|---|\n| Iron Condor | Sell OTM put spread + OTM call spread | Neutral markets, high IV |\n| Strangle | Sell OTM put + OTM call, same expiration | Low-cost setup, volatile markets |\n| Calendar Spread | Buy long-dated, sell short-dated same strike | Time decay, mean reversion |\n| Vertical Credit Spread | Bull put or Bear call spread | Directional trades with defined risk |\n\n## Backtest Engine\n\n```python\n#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\": round(width * 100, 2),\n        \"win_rate\": round((pnl_arr > 0).mean() * 100, 1),\n        \"avg_win\": round(pnl_arr[pnl_arr > 0].mean(), 2) if (pnl_arr > 0).any() else 0,\n        \"avg_loss\": round(pnl_arr[pnl_arr < 0].mean(), 2) if (pnl_arr < 0).any() else 0,\n        \"sharpe\": round(pnl_arr.mean() / (pnl_arr.std() + 1e-9), 2),\n        \"max_dd\": round(pnl_arr.min(), 2),\n        \"expectancy\": round((pnl_arr > 0).mean() * pnl_arr[pnl_arr > 0].mean() - \n                           (pnl_arr < 0).mean() * abs(pnl_arr[pnl_arr < 0].mean()), 2),\n        \"sample_size\": len(outcomes)\n    }\n\ndef run_backtest(strategy: str, symbol: str = \"SPY\", iv: float = 0.30, \n                 days: int = 45, short_delta: float = 0.20, width: float = 5.0):\n    results = []\n    for _ in range(20):  # 20 simulated entry points\n        price = np.random.uniform(400, 500)\n        r = simulate_iron_condor(price, iv, days, short_delta, width)\n        results.append(r)\n    \n    total_pnl = sum(r[\"net_credit\"] * 0.8 if r[\"win_rate\"] > 60 else -r[\"max_loss\"] * 0.2 \n                    for r in results)\n    \n    wins = [r for r in results if r[\"net_credit\"] > 0]\n    losses = [r for r in results if r[\"net_credit\"] <= 0]\n    \n    return {\n        \"strategy\": strategy, \"symbol\": symbol,\n        \"total_pnl_estimate\": round(total_pnl, 2),\n        \"avg_win_rate\": round(np.mean([r[\"win_rate\"] for r in results]), 1),\n        \"avg_sharpe\": round(np.mean([r[\"sharpe\"] for r in results]), 2),\n        \"max_drawdown\": round(min(r[\"max_dd\"] for r in results), 2),\n        \"win_count\": len(wins), \"loss_count\": len(losses),\n        \"edge\": round(np.mean([r[\"expectancy\"] for r in results]), 2)\n    }\n\nif __name__ == \"__main__\":\n    ap = argparse.ArgumentParser()\n    ap.add_argument(\"--strategy\", default=\"iron_condor\")\n    ap.add_argument(\"--symbol\", default=\"SPY\")\n    ap.add_argument(\"--iv\", type=float, default=0.30)\n    ap.add_argument(\"--days\", type=int, default=45)\n    ap.add_argument(\"--short-delta\", type=float, default=0.20)\n    ap.add_argument(\"--width\", type=float, default=5.0)\n    ap.add_argument(\"--output\", default=\"\")\n    args = ap.parse_args()\n    \n    result = run_backtest(args.strategy, args.symbol, args.iv, args.days, args.short_delta, args.width)\n    \n    print(f\"\\n{'='*55}\")\n    print(f\"  {result['strategy'].upper()} Backtest — {result['symbol']}\")\n    print(f\"{'='*55}\")\n    print(f\"  Win Rate:        {result['avg_win_rate']}%\")\n    print(f\"  Avg Sharpe:      {result['avg_sharpe']}\")\n    print(f\"  Max Drawdown:   ${result['max_drawdown']}\")\n    print(f\"  Win/Loss:        {result['win_count']}W / {result['loss_count']}L\")\n    print(f\"  Expectancy:     ${result['edge']}/trade\")\n    print(f\"  Est. Total P&L: ${result['total_pnl_estimate']}\")\n    print(f\"{'='*55}\")\n    \n    if args.output:\n        with open(args.output, \"w\") as f:\n            json.dump(result, f, indent=2, default=str)\n        print(f\"\\nResults saved to {args.output}\")\n```\n\n## Usage\n\n```bash\n# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10\n```\n\n## Default Config (config/strategies.json)\n\n```json\n{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}\n```\n\n## Error Handling\n\n- If IV < 20%, reject the trade (low IV = poor premium)\n- If bid-ask spread > $0.50, reject the trade\n- If days to expiration < 14, skip (too close to gamma crush)\n- Commission: $0.65/contract (4 legs = $2.60 per round trip)\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn723dy43mmbqpy0cp62hwptm984gga5\",\n  \"slug\": \"options-trading-backtester\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1777902235731\n}\n\nArchive v1.0.9: 2 files, 3046 bytes\n\nFiles: SKILL.md (7288b), _meta.json (145b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: options-trading-backtester\nversion: 1.0.9\ndescription: |\n  Build and run options strategy backtests in Python. Supports Iron Condor, Strangle,\n  Calendar Spread, Vertical Credit Spread. Tests against historical data with realistic\n  slippage, commission ($0.65/contract), and IV crush modeling. Outputs Sharpe ratio,\n  win rate, max drawdown, expectancy, and equity curve. Use when user asks to backtest\n  an options strategy, test a config, or analyze trade history.\ncompatibility: Python 3.10+, pandas, numpy, scipy, matplotlib. Optional: yfinance (free data).\nmetadata:\n  author: ssyopro.zo.computer\n  category: finance\n  display-name: Options Trading Backtester\n  tags: options, backtesting, trading-strategy, python, quant-finance, iron-condor, strangle\n---\n\n# Options Trading Backtester\n\nEvent-driven backtester for options strategies. Tests against synthetic or real historical data.\n\n## Strategy Types\n\n| Strategy | Description | Best For |\n|---|---|---|\n| Iron Condor | Sell OTM put spread + OTM call spread | Neutral markets, high IV |\n| Strangle | Sell OTM put + OTM call, same expiration | Low-cost setup, volatile markets |\n| Calendar Spread | Buy long-dated, sell short-dated same strike | Time decay, mean reversion |\n| Vertical Credit Spread | Bull put or Bear call spread | Directional trades with defined risk |\n\n## Backtest Engine\n\n```python\n#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\": round(width * 100, 2),\n        \"win_rate\": round((pnl_arr > 0).mean() * 100, 1),\n        \"avg_win\": round(pnl_arr[pnl_arr > 0].mean(), 2) if (pnl_arr > 0).any() else 0,\n        \"avg_loss\": round(pnl_arr[pnl_arr < 0].mean(), 2) if (pnl_arr < 0).any() else 0,\n        \"sharpe\": round(pnl_arr.mean() / (pnl_arr.std() + 1e-9), 2),\n        \"max_dd\": round(pnl_arr.min(), 2),\n        \"expectancy\": round((pnl_arr > 0).mean() * pnl_arr[pnl_arr > 0].mean() - \n                           (pnl_arr < 0).mean() * abs(pnl_arr[pnl_arr < 0].mean()), 2),\n        \"sample_size\": len(outcomes)\n    }\n\ndef run_backtest(strategy: str, symbol: str = \"SPY\", iv: float = 0.30, \n                 days: int = 45, short_delta: float = 0.20, width: float = 5.0):\n    results = []\n    for _ in range(20):  # 20 simulated entry points\n        price = np.random.uniform(400, 500)\n        r = simulate_iron_condor(price, iv, days, short_delta, width)\n        results.append(r)\n    \n    total_pnl = sum(r[\"net_credit\"] * 0.8 if r[\"win_rate\"] > 60 else -r[\"max_loss\"] * 0.2 \n                    for r in results)\n    \n    wins = [r for r in results if r[\"net_credit\"] > 0]\n    losses = [r for r in results if r[\"net_credit\"] <= 0]\n    \n    return {\n        \"strategy\": strategy, \"symbol\": symbol,\n        \"total_pnl_estimate\": round(total_pnl, 2),\n        \"avg_win_rate\": round(np.mean([r[\"win_rate\"] for r in results]), 1),\n        \"avg_sharpe\": round(np.mean([r[\"sharpe\"] for r in results]), 2),\n        \"max_drawdown\": round(min(r[\"max_dd\"] for r in results), 2),\n        \"win_count\": len(wins), \"loss_count\": len(losses),\n        \"edge\": round(np.mean([r[\"expectancy\"] for r in results]), 2)\n    }\n\nif __name__ == \"__main__\":\n    ap = argparse.ArgumentParser()\n    ap.add_argument(\"--strategy\", default=\"iron_condor\")\n    ap.add_argument(\"--symbol\", default=\"SPY\")\n    ap.add_argument(\"--iv\", type=float, default=0.30)\n    ap.add_argument(\"--days\", type=int, default=45)\n    ap.add_argument(\"--short-delta\", type=float, default=0.20)\n    ap.add_argument(\"--width\", type=float, default=5.0)\n    ap.add_argument(\"--output\", default=\"\")\n    args = ap.parse_args()\n    \n    result = run_backtest(args.strategy, args.symbol, args.iv, args.days, args.short_delta, args.width)\n    \n    print(f\"\\n{'='*55}\")\n    print(f\"  {result['strategy'].upper()} Backtest — {result['symbol']}\")\n    print(f\"{'='*55}\")\n    print(f\"  Win Rate:        {result['avg_win_rate']}%\")\n    print(f\"  Avg Sharpe:      {result['avg_sharpe']}\")\n    print(f\"  Max Drawdown:   ${result['max_drawdown']}\")\n    print(f\"  Win/Loss:        {result['win_count']}W / {result['loss_count']}L\")\n    print(f\"  Expectancy:     ${result['edge']}/trade\")\n    print(f\"  Est. Total P&L: ${result['total_pnl_estimate']}\")\n    print(f\"{'='*55}\")\n    \n    if args.output:\n        with open(args.output, \"w\") as f:\n            json.dump(result, f, indent=2, default=str)\n        print(f\"\\nResults saved to {args.output}\")\n```\n\n## Usage\n\n```bash\n# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10\n```\n\n## Default Config (config/strategies.json)\n\n```json\n{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}\n```\n\n## Error Handling\n\n- If IV < 20%, reject the trade (low IV = poor premium)\n- If bid-ask spread > $0.50, reject the trade\n- If days to expiration < 14, skip (too close to gamma crush)\n- Commission: $0.65/contract (4 legs = $2.60 per round trip)\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn723dy43mmbqpy0cp62hwptm984gga5\",\n  \"slug\": \"options-trading-backtester\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1777901407604\n}","readmeExcerpt":"Skill: Options Trading Backtester Owner: ssidharhubble Summary: Automated options trading backtester tool. Built by Shubh's autonomous Money Machine — self-improving based on live market data. Tags: latest:1.0.18 Version history: v1.0.18 | 2026-06-22T14:02:55.396Z | auto - Updated version number in SKILL.md from 1.0.17 to 1.0.18. - No other functional or content changes were made. v1.0.17 | 2026-06-22T13:54:20.923Z |","codeSnippets":[],"executableExamples":[{"language":"python","snippet":"#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\""},{"language":"bash","snippet":"# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10"},{"language":"json","snippet":"{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}"},{"language":"python","snippet":"#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_call_debit) * 100 if final_price > call_long_strike else \\\n                   (short_call_credit - long_call_debit) * 100 if final_price > call_short_strike else \\\n                   -(width * 100)\n        outcomes.append(put_pnl + call_pnl - COMMISSION * 4)\n    \n    pnl_arr = np.array(outcomes)\n    return {\n        \"net_credit\": round(net_credit, 2),\n        \"max_loss\""},{"language":"bash","snippet":"# Iron Condor backtest\npython scripts/backtest.py --strategy iron_condor --symbol SPY --iv 0.30 --days 45 --short-delta 0.20 --width 5\n\n# Strangle backtest\npython scripts/backtest.py --strategy strangle --symbol AAPL --iv 0.35 --days 30\n\n# Calendar spread\npython scripts/backtest.py --strategy calendar --symbol NVDA --days 45\n\n# Vertical credit spread\npython scripts/backtest.py --strategy vertical_spread --symbol TSLA --iv 0.40 --width 10"},{"language":"json","snippet":"{\n  \"iron_condor_default\": {\n    \"strategy\": \"iron_condor\",\n    \"short_delta\": 0.20,\n    \"wings_width\": 5,\n    \"expiration_days\": 45,\n    \"max_loss_per_trade\": 400,\n    \"starting_capital\": 10000\n  }\n}"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: options-trading-backtester\nversion: 1.0.18\ndescription: |\n  Build and run options strategy backtests in Python. Supports Iron Condor, Strangle,\n  Calendar Spread, Vertical Credit Spread. Tests against historical data with realistic\n  slippage, commission ($0.65/contract), and IV crush modeling. Outputs Sharpe ratio,\n  win rate, max drawdown, expectancy, and equity curve. Use when user asks to backtest\n  an options strategy, test a config, or analyze trade history.\ncompatibility: Python 3.10+, pandas, numpy, scipy, matplotlib. Optional: yfinance (free data).\nmetadata:\n  author: ssyopro.zo.computer\n  category: finance\n  display-name: Options Trading Backtester\n  tags: options, backtesting, trading-strategy, python, quant-finance, iron-condor, strangle\n---\n\n# Options Trading Backtester\n\nEvent-driven backtester for options strategies. Tests against synthetic or real historical data.\n\n## Strategy Types\n\n| Strategy | Description | Best For |\n|---|---|---|\n| Iron Condor | Sell OTM put spread + OTM call spread | Neutral markets, high IV |\n| Strangle | Sell OTM put + OTM call, same expiration | Low-cost setup, volatile markets |\n| Calendar Spread | Buy long-dated, sell short-dated same strike | Time decay, mean reversion |\n| Vertical Credit Spread | Bull put or Bear call spread | Directional trades with defined risk |\n\n## Backtest Engine\n\n```python\n#!/usr/bin/env python3\n\"\"\"Options Trading Backtester v1.0.\"\"\"\nimport json, argparse, numpy as np\nfrom typing import List, Dict\n\nCOMMISSION = 0.65  # $/contract\nSLIPPAGE = 0.02    # $/share\n\ndef simulate_iron_condor(price_at_entry: float, iv: float, days_to_exp: int, \n                         short_delta: float = 0.20, width: float = 5.0) -> Dict:\n    \"\"\"Simulate Iron Condor P&L.\"\"\"\n    put_short_strike = price_at_entry * (1 - short_delta)\n    put_long_strike  = put_short_strike - width\n    call_short_strike = price_at_entry * (1 + short_delta)\n    call_long_strike  = call_short_strike + width\n    \n    # Simplified premium model (uses IV and moneyness)\n    def premium(strike, is_put):\n        dist = abs(price_at_entry - strike) / price_at_entry\n        base = iv * price_at_entry * 0.3\n        return base * np.exp(-dist * 3) * (0.85 if is_put else 0.75)\n    \n    short_put_credit  = premium(put_short_strike, True)\n    long_put_debit    = premium(put_long_strike, True)\n    short_call_credit = premium(call_short_strike, False)\n    long_call_debit   = premium(call_long_strike, False)\n    \n    net_credit = (short_put_credit + short_call_credit) - (long_put_debit + long_call_debit)\n    \n    # Expiration P&L (simplified)\n    expiries = np.random.normal(0, price_at_entry * 0.02, 100)\n    outcomes = []\n    for final_price in expiries:\n        put_pnl  = (short_put_credit - long_put_debit) * 100 if final_price < put_long_strike else \\\n                   (short_put_credit - long_put_debit) * 100 if final_price < put_short_strike else \\\n                   -(width * 100)\n        call_pnl = (short_call_credit - long_"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn723dy43mmbqpy0cp62hwptm984gga5\",\n  \"slug\": \"options-trading-backtester\",\n  \"version\": \"1.0.18\",\n  \"publishedAt\": 1782136975396\n}"},{"path":"skill-card.md","content":"## Description:\n\nBuilds Python options strategy backtesting simulations for iron condors, strangles, calendar spreads, and vertical credit spreads, with outputs such as win rate, Sharpe ratio, drawdown, expectancy, and equity curve.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[ssidharhubble](https://clawhub.ai/user/ssidharhubble)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and analysts use this skill to draft and run Python-based options strategy simulations, test parameters, and summarize synthetic backtest-style metrics. Outputs should be reviewed before being used for trading decisions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Users may mistake simplified or synthetic options backtest outputs for realistic historical trading evidence or investment advice.\n\nMitigation: Treat outputs as synthetic simulations unless real data ingestion, strategy logic, risk filters, and financial disclaimers are independently reviewed and implemented.\n\n## Reference(s):\n\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration]\n\n**Output Format:** [Markdown with Python, bash, and JSON snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May produce synthetic options backtest metrics and optional JSON result files when an output path is configured.]\n\n## Skill Version(s):\n\n1.0.18 (source: frontmatter and server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Automated options trading backtester tool. Built by Shubh's autonomous Money Machine — self-improving based on live market data. Skill: Options Trading Backtester Owner: ssidharhubble Summary: Automated options trading backtester tool. Built by Shubh's autonomous Money Machine — self-improving based on live market data. Tags: latest:1.0.18 Version history: v1.0.18 | 2026-06-22T14:02:55.396Z | auto - Updated version number in SKILL.md from 1.0.17 to 1.0.18. - No other functional or content changes were made. v1.0.17 | 2026-06-22T13:54:20.923Z |","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1163,"uniquenessScore":48,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T04:47:52.041Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T04:47:52.041Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T10:52:47.948Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}