ib-create-consolidated-report
This skill merges multiple IBRK trade exports from a directory into consolidated reports, grouping trades by underlying symbol, strike, date, and position direction. It outputs both markdown and CSV formats with aggregated quantities, proceeds, commissions, and realized P&L.
IB Create Consolidated Report consolidates Interactive Brokers trade CSV files into unified summary reports.
AI-generated summary based on this skill's SKILL.md
Install
staskh/trading_skills/ib-create-consolidated-report · repository language: Python
git clone https://github.com/staskh/trading_skills
cp -r trading_skills/.claude/skills/ib-create-consolidated-report ~/.claude/skills/ib-create-consolidated-reportnpx skillfed install staskh/trading_skills/ib-create-consolidated-reportFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What does ib-create-consolidated-report do?
ib-create-consolidated-report merges multiple IBRK trade exports from a directory into consolidated reports, grouping trades by underlying symbol, strike, date, and position direction. It outputs both markdown and CSV formats with aggregated quantities, proceeds, commissions, and realized P&L.
How do I consolidate interactive brokers trade reports with this skill?
ib-create-consolidated-report processes all trade CSV files in a specified directory, automatically consolidating them into unified summary reports. The skill groups and aggregates trades by symbol, strike, date, and position type, then generates both markdown and CSV output files containing the consolidated data.
What output formats does ib-create-consolidated-report support?
ib-create-consolidated-report generates consolidated trade data in both markdown and CSV report formats. Both outputs include aggregated quantities, proceeds, commissions, and realized P&L information organized by symbol, strike, date, and position direction.
Can ib-create-consolidated-report include unrealized P&L in reports?
Yes, ib-create-consolidated-report can retrieve unrealized P&L directly from the IB gateway and include it in your consolidated output. This provides a complete picture of both realized and unrealized position performance alongside your trade aggregations.
How does ib-create-consolidated-report group and aggregate trades?
ib-create-consolidated-report groups trades by underlying symbol, strike price, date, and position type (long/short). It then aggregates quantities, proceeds, and commissions for each group, calculates realized P&L, and presents the results in organized summary reports for easy analysis.
What license does ib-create-consolidated-report use?
ib-create-consolidated-report is released under the MIT license, allowing free use, modification, and distribution with minimal restrictions.
SKILL.md
rendered from the published skill — quoted content, verbatim
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
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 2 files
.claude/skills/ib-create-consolidated-report/SKILL.md
.claude/skills/ib-create-consolidated-report/scripts/consolidate.py