Account and Order Subscriptions

These signatures come directly from PushClient.cs. Except for connection/status methods, subscription calls return a uint request ID and callbacks confirm the final result asynchronously.

Subscribe Account Changes

Operation

PushClient.Subscribe. Subscription, cancellation, or subscription-state query command on an established channel. A successful write is not server confirmation.

Request

uint Subscribe(Subject subject)
uint Subscribe(Subject subject, string? account)

Parameters

subject is Asset, Position, OrderStatus, or OrderTransaction; Subscribe has an optional account overload.

Return

Return: uint request ID. Subscribe completion arrives in SubscribeEnd; cancellation completion arrives in CancelSubscribeEnd.

Example

uint requestId = client.Subscribe(Subject.Asset, account);

Response type

// Actual completion callback
SubscribeEnd(int, string, string)

Callback Data Example

Asset:

{
    "account": "13810712",
    "currency": "USD",
    "segment": "S",
    "availableFunds": 2285040.55,
    "netLiquidation": 2285529.37,
    "buyingPower": 9140162.19,
    "cashBalance": 2284275.24,
    "grossPositionValue": 1143.04,
    "timestamp": "1669888806020"
}

Position:

{
    "account": "13810712",
    "symbol": "AAPL",
    "identifier": "AAPL",
    "market": "US",
    "secType": "STK",
    "positionQty": 4.0,
    "averageCost": 75.0,
    "latestPrice": 147.23,
    "marketValue": 588.92,
    "unrealizedPnl": 288.92,
    "timestamp": "1669888802018"
}

Order Status:

{
    "id": "28875370355884032",
    "account": "736845",
    "symbol": "CL",
    "action": "BUY",
    "orderType": "LMT",
    "totalQuantity": "1",
    "filledQuantity": "1",
    "avgFillPrice": 77.76,
    "status": "Filled",
    "timestamp": "1669200782221"
}

Source and related APIs

See Callbacks and the Streaming overview.

Unsubscribe Account Changes

Operation

PushClient.CancelSubscribe. Subscription, cancellation, or subscription-state query command on an established channel. A successful write is not server confirmation.

Request

uint CancelSubscribe(Subject subject)

Parameters

subject is Asset, Position, OrderStatus, or OrderTransaction; Subscribe has an optional account overload.

Return

Return: uint request ID. Subscribe completion arrives in SubscribeEnd; cancellation completion arrives in CancelSubscribeEnd.

Example

uint requestId = client.CancelSubscribe(Subject.Asset);

Response type

// Actual completion callback
CancelSubscribeEnd(int, string, string)

Source and related APIs

See Callbacks and the Streaming overview.


Did this page help you?