staskh avatar

Ib Pmcc Advisor

If you're running diagonal spreads in Interactive Brokers and want to stop manually checking every short call for assignment risk, this will pull your full PMCC book and rank which positions need attention. It calculates Black-Scholes delta and assignment probability for each short leg, projects daily P&L out to expiration, and surfaces the top three roll candidates with net credit and DTE comparisons. The earnings warnings are especially useful since it flags both your current short and any roll candidates that land in an earnings window. Requires TWS or IB Gateway running locally. The inline conversation view keeps red flags front and center, but you can request a full markdown report if you need it for records.

GitHub stars
248
last updated
Jun 11, 2026

Install

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

Installs into .claude/skills of the current project.

Files

IB PMCC Advisor

Analyzes all PMCC (diagonal call spread) positions in the IB portfolio and provides actionable advice on the short leg: assignment risk, P&L projections per day, and ranked roll recommendations.

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: Run the script

uv run python .claude/skills/ib-pmcc-advisor/scripts/pmcc_advisor.py [--port PORT] [--account ACCOUNT] [--min-roll-dte N] [--price-mode mid|last]

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-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
2sugarforever 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
3sugarforever 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
4superior-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
5syahiidkamil avatarfree-willsyahiidkamil/software-engineer-ai-agent-atlasDeliberate-choice procedure for a medium-to-high-stakes engineering fork — when the first plausible solution (the instinct, the default next-token pull) would b0skills.sh installs
6telagod avataranalyzing-spreadsheetstelagod/code-abyssProcesses Excel spreadsheet files (.xlsx, .xlsm, .csv). Creates workbooks, builds formulas, preserves formatting, analyzes tabular data, and validates financial0skills.sh installs