ib-report-delta-adjusted-notional-exposure
Skill411 starsChanged 9 days agoMITView on GitHub
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.
- Reads credentials
In this repository30 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- calendarSkill
- chart-ema-rsiSkill
- earnings-calendarSkill
- fundamentalsSkill
- greeksSkill
- ib-accountSkill
- ib-collarSkill
- ib-create-consolidated-reportSkill
- ib-find-short-rollSkill
- ib-option-chainSkill
- ib-pmcc-advisorSkill
- ib-portfolio-action-reportSkill
- ib-portfolioSkill
- ib-stop-lossSkill
- ib-trades-historySkill
- ib-trailing-stopSkill
- insider-tradingSkill
- markdown-to-pdfSkill
- news-sentimentSkill
- option-chainSkill
- price-historySkill
- report-stockSkill
- risk-assessmentSkill
- scanner-bullishSkill
- scanner-pmccSkill
- spread-analysisSkill
- stock-quoteSkill
- technical-analysisSkill
- whale-huntingSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Port fallback: If the configured port fails, automatically retry on the other port.
- Distinctive: line 19
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 …
- Distinctive: line 20
If both ports fail, ask the user to verify that TWS or IB Gateway is running with API access enabled.
- Very specific: line 34
Read templates/markdown-template.md for formatting instructions.
- Very specific: line 79
All timestamps and time-based calculations must use the America/New_York timezone.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
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_PORTenv var — default port when--portis omitted (e.g.IB_PORT=4001for a Gateway container). Precedence:--portflag >IB_PORT> built-in default. Set it in the shell or a.envfile.
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
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
Step 3: Report Results
Present the summary table (total long, short, net) and top exposures to the user. Include the saved report path.
Arguments
--port- IB port (default: 7497 for paper trading)
JSON Output
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 notionalby_account- Long/short breakdown by accountby_underlying- Long/short/net breakdown by symbol
Methodology
- Equity Options: Delta calculated via Black-Scholes with estimated IV based on moneyness
- Futures: Delta = 1.0 (full notional exposure)
- Futures Options: Delta calculated with lower IV assumption (20%)
- Stocks: Delta = 1.0
Delta-adjusted notional = delta x spot price x quantity x multiplier
Examples
# Paper trading (default)
uv run python scripts/delta_exposure.py
# Live trading
uv run python scripts/delta_exposure.py --port 7496Timezone
All timestamps and time-based calculations must use the America/New_York timezone. All JSON output must include generated_at (NY time string) and data_delay fields.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

