Appearance
Account & Portfolio
Account Summary
python
account = client.get_account_summary()Returns: Account dataclass
python
Account(
account_id='DUO903441',
net_liquidation=1004242.125,
available_funds=1002600.0625,
buying_power=6684000.5
)| Field | Type | Description |
|---|---|---|
account_id | str | IBKR account ID |
net_liquidation | float | Net liquidation value |
available_funds | float | Available funds for trading |
buying_power | float | Total buying power |
Positions
python
positions = client.get_positions()Returns: List[Position]
python
Position(
conid=265598,
symbol='AAPL',
position=7.0,
avg_cost=279.90,
market_value=1784.07,
unrealized_pnl=-175.24,
asset_class='STK'
)| Field | Type | Description |
|---|---|---|
conid | int | Contract ID |
symbol | str | Ticker symbol |
position | float | Quantity (negative = short) |
avg_cost | float | Average cost basis |
market_value | float | Current market value |
unrealized_pnl | float | Unrealized P&L |
asset_class | str | Asset class (STK, OPT, etc.) |
Single Position
python
position = client.get_position("AAPL") # Returns Position or NoneOrders
python
orders = client.get_orders()Returns: List[Dict] - Live/working orders from IBKR
python
{
'orderId': '738082742',
'order_ref': 'AQC-PNDVMMR-1769106017619',
'symbol': 'SPY',
'side': 'BUY',
'orderType': 'LMT',
'totalQuantity': 10,
'price': 690.50,
'status': 'Submitted',
'filledQuantity': 0
}Trades
python
trades = client.get_trades()Returns: List[Dict] - Recent executions
python
{
'execution_id': '00025b49.697429fe.01.01',
'order_id': 1014175394,
'order_ref': 'AQC-PNDVMMR-1769173921450',
'symbol': 'SPY',
'side': 'B',
'size': 3.0,
'price': '688.29',
'commission': '1.09',
'trade_time': '20260123-14:30:07',
'exchange': 'DRCTEDGE',
'conid': 756733
}| Field | Type | Description |
|---|---|---|
execution_id | str | Unique execution ID |
order_id | int | Parent order ID |
order_ref | str | cOID with strategy ID |
side | str | 'B' (buy) or 'S' (sell) |
size | float | Filled quantity |
price | str | Fill price |
commission | str | Commission charged |