Report delta-adjusted notional exposure across all IBKR accounts. Calculates option deltas using Black-Scholes and reports long/short exposure by account and underlying. Use when user asks about delta exposure, portfolio risk, or directional exposure.
Calculate and report delta-adjusted notional exposure across all Interactive Brokers accounts.
User must have TWS or IB Gateway running locally with API enabled:
uv run python scripts/delta_exposure.py [--port PORT]
The script returns JSON to stdout with all position deltas and summary data.
Read templates/markdown-template.md for formatting instructions. Generate a markdown report from the JSON data and save to .
sandbox/Filename: delta_exposure_report_{YYYYMMDD}_{HHMMSS}.md
Present the summary table (total long, short, net) and top exposures to the user. Include the saved report path.
--port - IB port (default: 7496 for live trading, use 7497 for paper)Returns delta-adjusted notional exposure with:
connected - Booleanaccounts - List of account IDsposition_count - Total positionspositions - Array of positions with symbol, delta, delta_notional, spot pricesummary - Totals for long, short, and net delta notional
by_account - Long/short breakdown by accountby_underlying - Long/short/net breakdown by symbolDelta-adjusted notional = delta x spot price x quantity x multiplier
# Live trading (default port 7496)
uv run python scripts/delta_exposure.py
# Paper trading (port 7497)
uv run python scripts/delta_exposure.py --port 7497