Skip to content
Back to skills

Ib Portfolio

ASecurity

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.

  • 373 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 26, 2026
datapythonbashapi

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add staskh/trading_skills --skill ib-portfolio --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ib Portfolio?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ib Portfolio
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/staskh-ib-portfolio/badge)](https://www.skillsdirectory.com/skills/staskh-ib-portfolio)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ib-portfolio
description: 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.
dependencies: ["trading-skills"]
---

# 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.

Files in this skill

  • SKILL.md1.3 KB
  • scripts/portfolio.py942 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.