Skip to content

Trades

ibc.rest.trades.Trades

Client for managing trades via the Interactive Brokers API.

__init__(ib_client, ib_session)

Initializes the Trades client.

Parameters

ib_client : InteractiveBrokersClient The InteractiveBrokersClient Python Client.

InteractiveBrokersSession

The IB session handler.

get_trades()

Returns a list of trades for the currently selected account for current day and six previous days.

Returns

list[Trade]: A collection of Trade resources.

Usage

>>> trades_service = ibc_client.trades
>>> trades_service.get_trades()