跳到正文
cccskills
免费在 GitHub 公开

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.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(2)

  • SKILL.md2.2 KB
  • scripts/consolidate.py11.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Get upcoming earnings dates with timing (before/after market) and EPS estimates. Use when user asks about earnings dates, earnings calendar, when a company reports, or upcoming earnings.

中文简介正在准备中。当前显示原文说明。

staskh/trading_skills3852026年10月21日 更新

Get fundamental financial data including financials, earnings, and key metrics. Use when user asks about financials, earnings, revenue, profit, balance sheet, income statement, or company fundamentals.

中文简介正在准备中。当前显示原文说明。

staskh/trading_skills3852026年10月21日 更新

greeks

免费

Calculate option Greeks (delta, gamma, theta, vega) and implied volatility for specific options. Use when user asks about Greeks, delta, gamma, theta, vega, IV, or option sensitivity analysis.

中文简介正在准备中。当前显示原文说明。

staskh/trading_skills3852026年10月21日 更新

ib_0dte

免费

Find and place the best 0DTE (zero-days-to-expiration) credit spreads from Interactive Brokers. Default execution route is the EMA9/EMA21 + VIX/VXN regime strategy (ema_vix_0dte.py), which auto-selects bull_put or bear_call from a bare EMA cross and skips the trade when the vol index is elevated (VXN ≥ 35 for NDX/QQQ, VIX ≥ 20 otherwise). Optional --rr-gate and --time-gate add red→red and bar-timing confirmation. Supports cash-settled indices (SPX, NDX, RUT, VIX) and any optionable stock/ETF. Manual spread type override is available via zero_dte.py. Requires TWS or IB Gateway running locally.

中文简介正在准备中。当前显示原文说明。

staskh/trading_skills3852026年10月21日 更新

Get account summary from Interactive Brokers including cash balance, buying power, and account value. Use when user asks about their account, balance, buying power, or available cash. Requires TWS or IB Gateway running locally.

中文简介正在准备中。当前显示原文说明。

staskh/trading_skills3852026年10月21日 更新

ib-collar

免费

Generate tactical collar strategy reports for protecting PMCC positions through earnings or high-risk events. Requires TWS or IB Gateway running locally.

中文简介正在准备中。当前显示原文说明。

staskh/trading_skills3852026年10月21日 更新

查看 staskh 的全部技能

报告此技能的问题