ib-portfolio

Solid

Get portfolio positions from Interactive Brokers. Use when user asks about their portfolio, positions, holdings, or what stocks they own. Requires TWS or IB Gateway running locally.

AI & Automation 229 stars 56 forks Updated today MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
79
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
51
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# IB Portfolio Fetch current portfolio positions from Interactive Brokers. ## Prerequisites User must have TWS or IB Gateway running locally with API enabled: - Paper trading: port 7497 - Live trading: port 7496 ## Instructions > **Note:** If `uv` is not installed or `pyproject.toml` is not found, replace `uv run python` with `python` in all commands below. ```bash uv run python scripts/portfolio.py [--port PORT] ``` ## Arguments - `--port` - IB port (default: 7496 for live trading) - `--account` - Specific IB account ID (optional, defaults to first account) ## Output Returns JSON with: - `connected` - Whether connection succeeded - `positions` - Array of positions with symbol, quantity, avg_cost, market_value, unrealized_pnl 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.

Details

Author
staskh
Repository
staskh/trading_skills
Created
3 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Data & Documents Solid

ib-portfolio-action-report

Generate a comprehensive portfolio action report with earnings dates and risk assessment. Use when user asks for portfolio review, action items, earnings risk, or position management across IB accounts. Requires TWS or IB Gateway running locally.

229 Updated today
staskh
AI & Automation Solid

ib-account

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.

229 Updated today
staskh
AI & Automation Solid

ib-trades-history

Fetch trade executions from Interactive Brokers filtered by account, date range, or symbol. Supports live API (~7 days history) and FlexReport (full history). Use when user asks about their trades, executions, or transaction history. Requires TWS or IB Gateway running locally.

229 Updated today
staskh
AI & Automation Solid

ib-option-chain

Get option chain data from Interactive Brokers including calls and puts with strikes, bids, asks, volume, and implied volatility. Use when user asks about options using IBKR data, or needs real-time option quotes from their broker. Requires TWS or IB Gateway running locally.

229 Updated today
staskh
Data & Documents Solid

ib-report-delta-adjusted-notional-exposure

Report delta-adjusted notional exposure across all IBKR accounts. Calculates option deltas using Black-Scholes and reports long/short exposure by account and underlying. Use when user asks about delta exposure, portfolio risk, or directional exposure.

229 Updated today
staskh