
This calculates delta-adjusted notional exposure across your Interactive Brokers accounts, which is essential if you're trading options and need to know your actual directional risk. It pulls live position data via the TWS API, runs Black-Scholes to compute deltas for options (with IV estimates based on moneyness), and aggregates everything into long/short exposure by account and underlying. The output is structured JSON that gets formatted into a markdown report with summary tables. Works with both paper and live trading ports. The methodology is straightforward: futures and stocks get delta of 1.0, equity options use proper Greeks, and futures options assume 20% IV. If you're managing multi-leg option strategies or just want to know if you're actually long or short SPY after all those spreads, this gives you the answer.
$ npx -y skills add staskh/trading_skills --skill ib-report-delta-adjusted-notional-exposure --agent claude-codeInstalls into .claude/skills of the current project.
Calculate and report delta-adjusted notional exposure across all Interactive Brokers accounts.
TWS or IB Gateway must be running locally with API enabled:
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.
uv run python scripts/delta_exposure.py [--port PORT]
The script returns JSON to stdout with all position deltas and summary data.
Sponsors