If you're running poor man's covered calls and have earnings coming up, this generates a tactical collar report showing exactly what put protection costs versus what you'd lose in a gap down. It pulls your actual PMCC positions from Interactive Brokers, checks if your structure is healthy or broken, then models short versus medium versus long-dated puts across gap scenarios. The analysis is surprisingly detailed about salvage value and implementation timing. You need TWS or IB Gateway running locally, and it assumes you only collar during high-risk events rather than holding permanent protection. Niche use case, but if you're in that specific situation the week before earnings, it beats spreadsheet guesswork.

GitHub stars
248
last updated
Jun 11, 2026

Install

$ npx -y skills add staskh/trading_skills --skill ib-collar --agent claude-code

Installs into .claude/skills of the current project.

Files

IB Tactical Collar

Generate a tactical collar strategy report for protecting PMCC positions through earnings or high-risk events.

IB Connection

TWS or IB Gateway must be running locally with API enabled:

  • Paper trading — port 7497
  • Live trading — port 7496
  • IB_PORT env var — default port when --port is omitted (e.g. IB_PORT=4001 for a Gateway container). Precedence: --port flag > IB_PORT > built-in default. Set it in the shell or a .env file.

Port fallback: If the configured port fails, automatically retry on the other port. If the retry succeeds, save to memory which account type worked (live/paper) and reuse it for all IB skill calls in this and future sessions — until the user explicitly asks for the other account. If both ports fail, ask the user to verify that TWS or IB Gateway is running with API access enabled.

Instructions

Step 1: Gather Data

uv run python scripts/collar.py SYMBOL [--port PORT] [--account ACCOUNT]

The script returns JSON to stdout with all position and scenario data.

Step 2: Format Report

Sponsors

Details

Repository
github.com/staskh/trading_skills
Categories
Backend & APIs, Finance & Trading
License
MIT
First seen
Jun 11, 2026

More from staskh/trading_skills

All 28
1staskh avatarib-find-short-rollstaskh/trading_skillsFind roll options for existing short positions OR find best covered call/put to open against long stock. Use when user asks about rolling shorts, finding roll c0skills.sh installs
2staskh avatarib-pmcc-advisorstaskh/trading_skillsAnalyze PMCC (Poor Man's Covered Call / diagonal spread) positions from IB portfolio. For each diagonal spread, reports short leg risk (delta, IV, assignment pr0skills.sh installs
3staskh avatarib-portfolio-action-reportstaskh/trading_skillsGenerate a comprehensive portfolio action report with earnings dates and risk assessment. Use when user asks for portfolio review, action items, earnings risk, 0skills.sh installs
4sugarforever avatarNext.js Security Scansugarforever/01coder-agent-skillsComprehensive security vulnerability scanner for Next.js and TypeScript/JavaScript projects. Detects OWASP Top 10 vulnerabilities, XSS, injection flaws, authent0skills.sh installs
5sugarforever avatarPython Security Scansugarforever/01coder-agent-skillsComprehensive security vulnerability scanner for Python projects including Flask, Django, and FastAPI applications. Detects OWASP Top 10 vulnerabilities, inject0skills.sh installs
6superior-trade avatarSuperior Tradesuperior-trade/superior-skillsSuperior Trade API key (x-api-key header). Obtained at https://account.superior.trade. Can create/manage backtests and deployments including live trading, and c0skills.sh installs