Skip to content
Automation
Skill

/ib-create-consolidated-report

Consolidate IBRK trade CSV files from a directory into a summary report. Groups trades by symbol, underlying, date, strike, buy/sell, and open/close. Outputs both markdown and CSV.

From plugin
staskh-trading-skills
36429 skills
Install
$ npx -y skills add staskh/trading_skills --skill ib-create-consolidated-report --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/ib-create-consolidated-report

Context preview

The summary Claude sees to decide when to auto-load this skill.

Consolidate IBRK trade CSV files from a directory into a summary report. Groups trades by symbol, underlying, date, strike, buy/sell, and open/close. Outputs both markdown and CSV.

SKILL.md

ib-create-consolidated-report.SKILL.md
name: ib-create-consolidated-report
description: Consolidate IBRK trade CSV files from a directory into a summary report. Groups trades by symbol, underlying, date, strike, buy/sell, and open/close. Outputs both markdown and CSV.
dependencies: ["trading-skills"]

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

Adds column:

  • **Position** - SHORT (Sell+Open), LONG (Buy+Open), CLOSE_SHORT (Buy+Close), CLOSE_LONG (Sell+Close)

Output

Generates two files in the output directory:

  • `consolidated_trades_YYYY-MM-DD_HHMM.md` - Markdown report with summary tables
  • `consolidated_trades_YYYY-MM-DD_HHMM.csv` - CSV with all consolidated data

Example Usage

# Consolidate trades from IBRK reports directory
uv run python scripts/consolidate.py "C:\Users\avrah\OneDrive\Business\Trading\IBRK reports\2stastrading2025"

# Specify custom output directory
uv run python scripts/consolidate.py "C:\path\to\reports" --output-dir "C:\output"

Timezone

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.

Read more
Ships withstaskh-trading-skills

Most retail traders juggle 5+ tabs — broker, charting platform, screener, news feed, spreadsheet — just to decide whether to enter a trade. This project collapses all of that into a single conversational interface powered by Claude.

Get the whole plugin
Stats
364
Stars
82
Forks
Active
Maintenance
Python
Language
MIT
License
1d ago
Last commit
6mo ago
Created

Repo: staskh/trading_skills

Other skills on staskh-trading-skills.