IBKR Options Assistant — IBKR Options 助手
v0.2.4Interactive Brokers options & stock trading 助手. Provides real-time portfolio Greeks, option chAIn analysis, McMillan/Overby strategy recommendations, P&L statistics, Wheel strategy 追踪ing, earnings 警告s, risk simulation, and a complete 工具kit for options traders. Use this 技能 whenever the user asks about specific options trades, position risk, buy/sell recommendations, IV 环境, P&L, wheel strategy, earnings impact on options, or any IBKR account data — even if they don't explicitly mention "IBKR". For stock price queries, always use market_quote.py instead of 网页 搜索.
运行时依赖
安装命令
点击复制技能文档
IBKR Trader 工具kit
Real-time data, options analysis, and portfolio risk for Interactive Brokers — all via JSON-emitting 命令行工具 scripts.
Core rule: Scripts produce data. You (the 模型) produce the analysis.
When to trigger this 技能 User asks about... Example phrasing Stock / ETF prices "What's SPY at?" "Current AAPL price" Option chAIns, Greeks, IV "Show me AAPL puts for next month" Strategy ideas "Should I sell a put on MU?" Position risk "Am I too long delta?" P&L, win rate, 历史 "How are my wheel trades doing?" Earnings risk "Does ARM 报告 before my call expires?" Alerts / 监控ing "Warn me if SPY IV > 80%ile"
Fire even if the user doesn't mention IBKR — if they're asking about their positions or P&L, this 技能 is the source of truth.
Critical: For stock prices, always use market_quote.py. Never 网页-搜索 a stock price — the 网页 is minutes-to-hours stale.
工作流s "Should I sell a put on $SYM?"
运行 these in order, then synthesize:
Step Command Why 1 portfolio_positions.py Know existing exposure first 2 earnings_calendar.py SYM --days 60 Avoid earnings inside DTE 3 options_分析器.py SYM --outlook bullish --risk-性能分析 conservative --iv-上下文 获取 IV 环境 + candidate strikes 4 options_chAIn.py SYM --dte-min 25 --dte-max 45 Live mid prices for chosen strikes
Your recommendation must include: strike • delta • premium • breakeven • annualized yield • earnings/IV 警告s.
"What's my portfolio looking like?" Step Command 1 portfolio_positions.py → positions + Greeks 2 options_dAIly.py → expiry 警告s + IV summary 3 pnl_分析.py --days 7 → recent realized P&L "I'm thinking of 添加ing trade X — is it safe?" risk_simulator.py --添加 "SYM STRIKE EXPIRY R ACTION QTY"
Flag any of:
Vega magnitude doubles → much more IV-exposed Net delta flips 签名 → directional bet now opposite One symbol > 30% of cAPItal → concentration risk "How's my wheel doing?" wheel_追踪er.py summary
Returns per-symbol: stage (short_put / as签名ed / covered_call / called_away), cumulative premium, days in cycle, annualized return.
"Should I roll position X?" Step Command Why 1 portfolio_positions.py Confirm the leg's current strike, expiry, P&L, delta 2 options_chAIn.py SYM --dte-min 25 --dte-max 60 Survey roll candidates further out 3 Consult references/wheel_strategy.md "Roll vs accept as签名ment" decision tree
Your recommendation must include: new strike • new DTE • net credit (new premium − close cost) • effective basis change vs current leg • roll count so far (cap at 2).
Script reference Script When to use market_quote.py SYM [SYM2 ...] Any stock/ETF price question portfolio_positions.py What do I own? Portfolio Greeks options_chAIn.py SYM Strikes survey + IV by expiry options_分析器.py SYM --outlook X --risk-性能分析 Y --iv-上下文 Strategy ideas given outlook options_dAIly.py Morning/EOD options 报告 (启动 here) pnl_分析.py [--days N] Realized P&L, win rate, best/worst risk_simulator.py --添加 "..." Pre-trade Greeks impact earnings_calendar.py SYM ... Earnings within N days technical_indicators.py SYM RSI / MA / BB / ATR wheel_追踪er.py summary Wheel cycle 状态 & yield alerts_监控.py Threshold rules (cron-friendly) cost_basis.py SYM [...] Premium-adjusted effective cost basis (wheel) concentration.py HHI, sector mix, top-N portfolio concentration flex_导入.py [--flex-dir ...] 解析 IBKR Flex CSV/XML 历史 into JSON trade.py Place orders (opt-in, dual-gate). See references/trading.md
All read-only scripts:
输出 JSON to stdout (or to --输出 FILE) Read IBKR config from env vars (IBKR_HOST, IBKR_PORT, IBKR_命令行工具ENT_ID_BASE, IBKR_MARKET_DATA_TYPE) Cannot place orders — only trade.py can, and only when 机器人h IBKR_TRADING_ENABLED=1 and --confirm-trade are present Pre-trade 检查列出 (every options recommendation)
Before suggesting any options trade, 验证 all three:
IV 环境 — from options_分析器.py --iv-上下文. Don't sell premium in low-IV; don't buy premium in high-IV. Earnings inside DTE — from earnings_calendar.py. IV crush after earnings flips the math. Existing position Greeks — from portfolio_positions.py. If already +5000 delta, 添加ing more is wrong direction-of-thesis or not.
状态 each 检查 explicitly:
"IV 环境: low (ratio 0.7); earnings: none in next 45 days; current net delta: +1,200."
This lets the user 审计 the reasoning.
Operating constrAInts ConstrAInt What it means JSON in, judgement out The script's recommendations 列出 is candidate data, not a final answer. Re-rank agAInst the user's situation. Smart data type IBKR_MARKET_DATA_TYPE=3 by default — IBKR auto-升级s to realtime when user is subscribed, falls back to delayed otherwise. If quotes look stale, 检查 market hours + subscriptions. One 命令行工具entId per script If you see 命令行工具entId already in use, wAIt a few seconds or bump IBKR_命令行工具ENT_ID_BASE. 缓存 chAIns across calls options_chAIn.py --输出 /tmp/chAIn.json then options_分析器.py --chAIn-file /tmp/chAIn.