Skip to content

Trading:Balances

Announces the current balances of a Trading Account

Controller: Trading
Topic: Balances or Balances![ID]
Action: Sub
Permissions: Zenith/Trading
Server-side Unsubscribe: Yes

FormatDescriptionExample
BalancesReceive all balance data available on this login.Balances
Balances![ID]Receive balance data for a specific Trading Account.Balances!OM1234
NameDescription
IDThe Trading Account identifier to announce Balances for.

An ordered array of zero or more Balance objects, to be applied in sequence.

NameTypeExpectDescription
AccountStringAlwaysThe unique identifier for the Account
TypeStringAlwaysThe funds type. If an empty string, the Balance records for this Account are being cleared before a full update. Currency will also be empty.
CurrencyStringAlwaysThe three-letter currency code. Will be an empty string on a clear.
AmountDecimalAlwaysThe amount of funds available. An amount of zero should be considered a removal of this balance record.

Send:

{"Controller":"Trading","Topic":"Balances!OM12345","Action":"Sub","Confirm":true}

Receive:

{
"Controller":"Trading",
"Topic":"Balances!OM12345",
"Data":
[
{"Account":"OM12345","Type":"","Currency":"","Amount":0},
{"Account":"OM12345","Type":"NetBalance","Currency":"AUD","Amount":1234.56}
]
}
{"Controller":"Trading","Topic":"Balances!OM12345","Action":"Sub","Confirm":true}