> For the complete documentation index, see [llms.txt](https://tradesync.gitbook.io/tradesync/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tradesync.gitbook.io/tradesync/fxtr-v2/functions-of-fxtr-v2/open-stream-for-the-account/messages-that-can-be-sent-in-open-stream/subscriptions/accountstate.md).

# AccountState

**Triggered by:** [AccountStateSubscribe](/tradesync/fxtr-v2/functions-of-fxtr-v2/open-stream-for-the-account/messages-that-can-be-sent-in-open-stream/accountstatesubscribe.md).

**Switched off by**: [AccountStateUnsubscribe](/tradesync/fxtr-v2/functions-of-fxtr-v2/open-stream-for-the-account/messages-that-can-be-sent-in-open-stream/accountstateunsubscribe.md).

**Response Type** - `AccountState`.

**Response Body Fields:** the structure is indentical to [GetOrders](/tradesync/fxtr-v2/functions-of-fxtr-v2/open-stream-for-the-account/messages-that-can-be-sent-in-open-stream/getorders.md) with additional key in body:

<table><thead><tr><th width="198">Parameter</th><th width="128">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>time</code></td><td><code>int64</code></td><td>time of message generated in milliseconds in UTC</td></tr></tbody></table>

**Example:**

```json
{
    "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
            }
          ]
        }
      }

```
