latestOpenAPI 3.1.02026-08-22181751733.6 KB

67f9f562c2c6

tradingPortfolio

Account Positions (NEW)

Returns a list of positions for the given account. /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint. This endpoint provides near-real time updates and removes caching otherwise found in the /portfolio/{accountId}/positions/{pageId} endpoint.

get/portfolio2/{accountId}/positions

Path parameters

accountIdstring required

Query parameters

modelstring
direction'a' | 'd'

The chronologic order of orders to sort by.

  • a - Display in ascending order.
  • d - Display in descending order.

Response

response with position details

assetClassstring

Asset class of the requested instrument.

{"stackTrail":"components:schemas:Portfolio2PositionsItems:properties:avgCost","oasType":"schema","type":"unknown","description":"The account's average cost for its position."}
avgPricenumber double

The account's average price for its position.

conidinteger

IB contract ID for the instrument.

currencystring

Currency in which the instrument trades.

descriptionstring

Contract's local symbol

groupstring

Industry sub-categorization of the instrument.

isLastToLoqboolean
marketPricenumber double

Current market price of the instrument, in the instrument's currency.

marketValuenumber double

Current market value of the account's position in the instrument, in the instrument's currency.

modelstring

Name of the model portfolio in which the account is invested that contributes this position.

positionnumber double

Size of position in units of instrument.

realizedPnlnumber double

Realized PnL for the instrument in the instrument's currency.

secTypestring

The security type of the instrument.

sectorstring

Industry sector categorization of the instrument.

timestampinteger

Time taken to retrieve position data in milliseconds.

unrealizedPnlnumber double

Unrealized PnL for the instrument in the account.