Agent Skillsstaskh/trading_skills › ib-account

ib-account

GitHub

从 Interactive Brokers 获取账户摘要,包括现金余额、购买力和账户价值。当用户询问账户、余额或可用资金时触发。需本地运行 TWS 或 IB Gateway。

.claude/skills/ib-account/SKILL.md staskh/trading_skills

触发场景

查询账户状态 查看现金余额 检查购买力 获取可用资金

安装

npx skills add staskh/trading_skills --skill ib-account -g -y
更多选项

非标准路径

npx skills add https://github.com/staskh/trading_skills/tree/main/.claude/skills/ib-account -g -y

不安装直接使用

npx skills use staskh/trading_skills@ib-account

指定 Agent (Claude Code)

npx skills add staskh/trading_skills --skill ib-account -a claude-code -g -y

安装 repo 全部 skill

npx skills add staskh/trading_skills --all -g -y

预览 repo 内 skill

npx skills add staskh/trading_skills --list

SKILL.md

Frontmatter
{
    "name": "ib-account",
    "description": "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.",
    "dependencies": [
        "trading-skills"
    ]
}

IB Account

Fetch account summary from Interactive Brokers.

IB Connection

TWS or IB Gateway must be running locally with API enabled:

  • Paper trading — port 7497
  • Live trading — port 7496

Port fallback: If the configured port fails, automatically retry on the other port. If the retry succeeds, save to memory which account type worked (live/paper) and reuse it for all IB skill calls in this and future sessions — until the user explicitly asks for the other account. If both ports fail, ask the user to verify that TWS or IB Gateway is running with API access enabled.

Instructions

Note: If uv is not installed or pyproject.toml is not found, replace uv run python with python in all commands below.

uv run python scripts/account.py [--port PORT] [--account ACCOUNT_ID] [--all-accounts]

Arguments

  • --port - IB port (default: 7497 for paper trading)
  • --account - Specific account ID to fetch
  • --all-accounts - Fetch summaries for all managed accounts

Default behavior (no flags): fetches the first managed account only. Always use --all-accounts unless the user asks for a specific account.

Output

Returns JSON with:

  • connected - Whether connection succeeded
  • accounts - List of account summaries, each with account ID, net liquidation, cash, buying power, etc.

If not connected, explain that TWS/Gateway needs to be running.

Dependencies

  • ib-async

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.

版本历史

  • cc30858 当前 2026-07-05 11:04

依赖关系

  • required trading-skills

同 Skill 集合

.claude/skills/earnings-calendar/SKILL.md
.claude/skills/fundamentals/SKILL.md
.claude/skills/greeks/SKILL.md
.claude/skills/ib-collar/SKILL.md
.claude/skills/ib-create-consolidated-report/SKILL.md
.claude/skills/ib-find-short-roll/SKILL.md
.claude/skills/ib-option-chain/SKILL.md
.claude/skills/ib-pmcc-advisor/SKILL.md
.claude/skills/ib-portfolio-action-report/SKILL.md
.claude/skills/ib-portfolio/SKILL.md
.claude/skills/ib-report-delta-adjusted-notional-exposure/SKILL.md
.claude/skills/ib-stop-loss/SKILL.md
.claude/skills/ib-trades-history/SKILL.md
.claude/skills/ib-trailing-stop/SKILL.md
.claude/skills/insider-trading/SKILL.md
.claude/skills/markdown-to-pdf/SKILL.md
.claude/skills/news-sentiment/SKILL.md
.claude/skills/option-chain/SKILL.md
.claude/skills/price-history/SKILL.md
.claude/skills/report-stock/SKILL.md
.claude/skills/risk-assessment/SKILL.md
.claude/skills/scanner-bullish/SKILL.md
.claude/skills/scanner-pmcc/SKILL.md
.claude/skills/spread-analysis/SKILL.md
.claude/skills/stock-quote/SKILL.md
.claude/skills/technical-analysis/SKILL.md
.claude/skills/whale-hunting/SKILL.md

元信息

文件数
0
版本
cc30858
Hash
e9a65704
收录时间
2026-07-05 11:04

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-14 22:14
浙ICP备14020137号-1 $访客地图$