Home Platform Algorithms Charts Pricing Documentation Register Account

Balances balances

Request and subscribe to balance updates from your connected exchange accounts.

Request

Request your current balances (margin / collateral).

Send

message array ["request", "balances", requestId?]
instruction string = "request"
Specify that message is a request for data.
topic string = "balances"
The balances topic.
requestId string
(Optional) Any string to correlate the response.

Example:

socket.send('["request", "balances"]');

Receive

The response will take the form:

message array [topic, data]
topic string
The balances topic.
balances array [balance, ...]
An array of balances.
balance object
The balance data with fields below.

See Message Structure for the format of responses to requests made with a requestId.

Subscribe

Subscribe to balance updates.

Send

message array ["subscribe", "balances"]
instruction string = "subscribe"
Specify that message is an instruction to begin streaming data.
topic string
The balances topic.

Example:

socket.send('["subscribe", "balances"]');

Receive

Subscription updates are identical to the response above.

Fields

FieldTypeValuesFXCMOANDABitMEXBinanceBitfinex
brokerstringFXCM
OANDA
BitMEX
Binance
Bitfinex
accountNostring
balancenumber
equity
Balance plus unrealized profit
number
available
Margin available to trade (balance less used margin)
number
used
Margin held for open orders and positions
number
orderMargin
Margin held for open orders
number
positionMargin
Margin held for open positions
number
marginRationumber
marginCallboolean
typestringTRADING
DEPOSIT
EXCHANGE

Was this page useful? If you find any errors or have any questions please get in touch at support@cloud9trader.com.