
Ib Create Consolidated Report
If you're trading options on Interactive Brokers and drowning in CSV exports, this consolidates them into something readable. Point it at a directory of IBRK trade files and it groups everything by underlying symbol, strike, date, and whether you're opening or closing positions. It calculates totals for quantity, proceeds, commissions, and realized P&L, then spits out both markdown and CSV reports. The auto-probe feature for IB Gateway ports is a nice touch since you won't have to remember whether you're on paper or live. Straightforward Python script that does exactly what the name suggests without any extra ceremony.
- GitHub stars
- 248
- last updated
- Jun 11, 2026
Install
$ npx -y skills add staskh/trading_skills --skill ib-create-consolidated-report --agent claude-codeInstalls into .claude/skills of the current project.
Files
IB Create Consolidated Report
Reads all CSV files from a given directory (excluding subdirectories), consolidates trade data by key fields, and generates both markdown and CSV reports.
Instructions
uv run python scripts/consolidate.py <directory> [--port PORT] [--output-dir OUTPUT_DIR]
Arguments
directory- Path to directory containing IBRK trade CSV files--port- IB port to fetch unrealized P&L (7497=paper, 7496=live). If not specified, auto-probes both ports (tries 7496 first, then 7497). Defaults to theIB_PORTenv var when set (--portstill overrides).--output-dir- Output directory for reports (default: sandbox/)
Consolidation Logic
Groups trades by:
- UnderlyingSymbol - The underlying ticker (e.g., GOOG, CAT)
- Symbol - Full option symbol
- TradeDate - Date of the trade
- Strike - Strike price
- Put/Call - Option type (C or P)
- Buy/Sell - Trade direction
- Open/CloseIndicator - Whether opening or closing
Aggregates:
- Quantity - Sum of quantities
- Proceeds - Sum of proceeds
- NetCash - Sum of net cash
- IBCommission - Sum of commissions
- FifoPnlRealized - Sum of realized P&L
Sponsors
Details
- Repository
- github.com/staskh/trading_skills
- Categories
- Sales & Marketing, Finance & Trading
- License
- MIT
- First seen
- Jun 11, 2026
More from staskh/trading_skills
All 28- Ib Find Short Roll
- Ib Option Chain
- Ib Pmcc Advisor
- Ib Portfolio
- Ib Portfolio Action Report
- Ib Report Delta Adjusted Notional Exposure
- Ib Stop Loss
- Ib Trades History
- Ib Trailing Stop
- Insider Trading
- Markdown To Pdf
- Price History
- Scanner Bullish
- Scanner Pmcc
- Spread Analysis
- Whale Hunting
- Technical Analysis598
- News Sentiment246
- Fundamentals182
- Stock Quote131
- Greeks128
- Report Stock117
- Option Chain111
- Risk Assessment105