staskh avatar

Ib Report Delta Adjusted Notional Exposure

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.

GitHub stars
248
last updated
Jun 11, 2026

Install

$ npx -y skills add staskh/trading_skills --skill ib-report-delta-adjusted-notional-exposure --agent claude-code

Installs into .claude/skills of the current project.

Files

IB Delta-Adjusted Notional Exposure Report

Calculate and report delta-adjusted notional exposure across all Interactive Brokers accounts.

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/delta_exposure.py [--port PORT]

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

Step 2: Format Report

Sponsors

Details

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

More from staskh/trading_skills

All 28

Recommended

More Python
1syahiidkamil avatarmcp-buildersyahiidkamil/software-engineer-ai-agent-atlasGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when b0skills.sh installs
2tbartel74 avatarsecurity-audit-scannertbartel74/Vigil-CodeAutomated security scanning for Vigil Guard v2.0.0. Use for OWASP Top 10 checks, TruffleHog secret detection, npm/pip vulnerability scanning, 3-branch service s0skills.sh installs
3thinkinaixyz avatarmcp-builderthinkinaixyz/deepchatGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when b0skills.sh installs
4mindrally avatarfastapi-pythonmindrally/skillsExpert in FastAPI Python development with best practices for APIs and async operations14Kskills.sh installs
5mindrally avatardjango-pythonmindrally/skillsExpert in Django Python web development with best practices965skills.sh installs
6sickn33 avatarpython-fastapi-developmentsickn33/antigravity-awesome-skillspython fastapi development420skills.sh installs