ib-trades-history
Pull trade executions directly from your Interactive Brokers account via live API (recent ~7 days) or FlexReport (full history). Filter by account, symbol, or date range, and get back execution details with per-symbol summaries including commissions and realized P&L.
IB Trades History retrieves your recent or full trade executions from Interactive Brokers with flexible filtering.
AI-generated summary based on this skill's SKILL.md
Install
staskh/trading_skills/ib-trades-history · repository language: Python
git clone https://github.com/staskh/trading_skills
cp -r trading_skills/.claude/skills/ib-trades-history ~/.claude/skills/ib-trades-historynpx skillfed install staskh/trading_skills/ib-trades-historyFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I pull my trade history from ib-trades-history?
ib-trades-history retrieves trade executions directly from your Interactive Brokers account. You can access recent trades (~7 days) via the live IB API, or use FlexReport to pull your full historical trade data. The skill filters results by account, symbol, or date range and returns execution details with per-symbol summaries including commissions and realized P&L.
Can ib-trades-history get full trading history beyond 7 days?
Yes. ib-trades-history accesses full trade history beyond the 7-day API limit via Interactive Brokers' FlexReport feature. This allows you to retrieve historical trades across any date range you specify, making it ideal for reconciliation, tax reporting, or long-term portfolio analysis.
How do I fetch my AAPL trades from ib-trades-history?
ib-trades-history lets you filter and export trades by symbol. Simply specify AAPL (or any other ticker) along with your desired date range and account, and the skill returns all matching executions with full transaction details, commissions, and realized P&L for that symbol.
What connection setup does ib-trades-history require?
ib-trades-history connects to Interactive Brokers via the IB API, which runs through either TWS (Trader Workstation) or IB Gateway. You'll need to configure your IB API connection settings in one of these applications before the skill can retrieve your trade data.
Can ib-trades-history export trades from multiple accounts?
Yes. ib-trades-history supports filtering and exporting trades across multiple Interactive Brokers accounts. You can reconcile portfolio activity or analyze transaction details by specifying which accounts to include in your query.
SKILL.md
rendered from the published skill — quoted content, verbatim
IB Trades History
Fetch trade executions from Interactive Brokers.
IB Connection
TWS or IB Gateway must be running locally with API enabled:
- Paper trading — port 7497
- Live trading — port 7496
- IB_PORT env var — default port when --port is omitted (e.g. IB_PORT=4001 for a Gateway container). Precedence: --port flag > IB_PORT > built-in default. Set it in the shell or a .env file.
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.
For full trade history beyond ~7
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 2 files
.claude/skills/ib-trades-history/SKILL.md
.claude/skills/ib-trades-history/scripts/trades.py