ib-create-consolidated-report
@staskh · 收录于 1 周前
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.
适合你,如果你需要合并多个IBRK交易CSV文件生成汇总报告
/ 下载安装
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code
~/.claude/skills/(项目级 .claude/skills/)Codex CLI
~/.codex/skills/Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add staskh/trading_skills/ib-create-consolidated-report/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- staskh/trading_skills/ib-create-consolidated-report/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify staskh/trading_skills/ib-create-consolidated-report安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
288GitHub stars
~465最小装载
~2.6K含声明引用
~2.6K文本包总量
镜像托管
怎么用
技能原文 SKILL.md
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).--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 tablesconsolidated_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.
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →
评论
登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。
…