staskh avatar

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-code

Installs 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 the IB_PORT env var when set (--port still 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
1Synerise avatarpush-mrSynerise/synerise-designPush current branch to origin, create a GitLab MR if one doesn't exist, and monitor the pipeline until completion0skills.sh installs
2TalAter avatartriageTalAter/annyangTriage and close GitHub issues on TalAter/annyang0skills.sh installs
3telagod avatarautomating-devopstelagod/code-abyssDevOps knowledge reference covering Git workflows, testing strategies, DevSecOps, release pipeline orchestration (release.yml, multi-arch images, cosign integra0skills.sh installs
4telagod avatardesigning-hardware-productstelagod/code-abyssAI-automated hardware product pipeline: from requirements to manufacturable Gerber + compiled firmware + cross-platform app. Orchestrates system design, ESP-IDF0skills.sh installs
5tzachbon avatarPlugin Structuretzachbon/smart-ralphHandles everything around creating and organizing Claude Code plugins, from initial scaffolding to understanding the component discovery...0skills.sh installs
6utopai-research avatarvideo-composeutopai-research/pai-proGenerates and prompts video clips on the filmmaking canvas. Use when the user asks to generate, render, animate, continue, restyle, edit, shoot, or compose a vi0skills.sh installs