AccountState

Triggered by: AccountStateSubscribe.

Switched off by: AccountStateUnsubscribe.

Response Type - AccountState.

Response Body Fields: the structure is indentical to GetOrders with additional key in body:

Parameter
Type
Description

time

int64

time of message generated in milliseconds in UTC

Example:

{
    "type": "AccountState",
    "body": {
        "balance": 9999.93,
        "account": 69991,
        "equity": 28737.8,
        "credit": 0,
        "margin": 134.41,
        "margin_level": 21380.7,
        "free_margin": 28603.4,
        "currency": "USD",
        "time": 1689605601412,
        "orders": [
            {
                "ticket": 11876746,
                "position_id": 11876746,
                "price": 1.123030,
                "current_price": 1.070950,
                "volume": 0.010000,
                "type": 1,
                "symbol": "EURUSD.s",
                "comment": "",
                "sl": 0.000000,
                "tp": 0.000000,
                "commission": 0,
                "swap": -0.070000,
                "profit": 52.080000,
                "margin_rate": 1.123030,
                "state": 0,
                "time_created": 1689605601412,
                "time_updated": 1689605601412
            },            {
                "ticket": 11877104,
                "position_id": 11877104,
                "price": 1.123400,
                "current_price": 1.070960,
                "volume": 0.010000,
                "type": 1,
                "symbol": "EURUSD.s",
                "comment": "",
                "sl": 0.000000,
                "tp": 0.000000,
                "commission": 0,
                "swap": -0.070000,
                "profit": 52.440000,
                "margin_rate": 1.123400,
                "state": 0,
                "time_created": 1689605857196,
                "time_updated": 1689605857196
            }
        ],
        "pendings": [
            {
                "ticket": 11809633,
                "position_id": 0,
                "type": 2,
                "price": 1.000000,
                "price_trigger": 0.000000,
                "price_current": 1.070960,
                "volume": 0.010000,
                "symbol": "EURUSD.s",
                "comment": "",
                "sl": 0.000000,
                "tp": 0.000000,
                "commission": 0,
                "swap": 0,
                "profit": 0,
                "margin_rate": 1.000000,
                "state": 1,
                "time_created": 1688131994193,
                "time_updated": 1688131994193
            },
            {
                "ticket": 11809634,
                "position_id": 0,
                "type": 2,
                "price": 1.000000,
                "price_trigger": 0.000000,
                "price_current": 1.070960,
                "volume": 0.010000,
                "symbol": "EURUSD.s",
                "comment": "",
                "sl": 0.000000,
                "tp": 0.000000,
                "commission": 0,
                "swap": 0,
                "profit": 0,
                "margin_rate": 1.000000,
                "state": 1,
                "time_created": 1688131994394,
                "time_updated": 1688131994394
            }
          ]
        }
      }

Last updated