> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# Account Class

## Definition

The Account class can be used to subscribe to account-related events as well as access account-related information.

Also happens when rewinding/fast forwarding Playback connections.

## Static Account Class Properties

| Property                                                                                                    | Description                              |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| **All**                                                                                                     | A collection of Account objects          |
| **[AccountStatusUpdate](/developer/desktop-sdk/references/add-on/account-class/accountstatusupdate)**       | Event handler for account status updates |
| **[SimulationAccountReset](/developer/desktop-sdk/references/add-on/account-class/simulationaccountreset)** | Event handler for resets on sim accounts |

## Methods and Properties From Account instances

| Property                                                                                                 | Description                                                                                                   |
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| **[AccountItem](/developer/desktop-sdk/references/add-on/account-class/accountitem)**                    | Represents various account variables used to reflect values the status of the account                         |
| **[AccountItemUpdate](/developer/desktop-sdk/references/add-on/account-class/accountitemupdate)**        | Event handler for changes to account values                                                                   |
| **[Cancel()](/developer/desktop-sdk/references/add-on/account-class/cancel)**                            | Cancels specified order(s) on the account                                                                     |
| **[CancelAllOrders()](/developer/desktop-sdk/references/add-on/account-class/accounts-cancelallorders)** | Cancels all orders of an instrument on the account                                                            |
| **[Change()](/developer/desktop-sdk/references/add-on/account-class/change)**                            | Changes specified order(s) on the account                                                                     |
| **[Connection](/developer/desktop-sdk/references/add-on/account-class/connection)**                      | A Connection representing the connection this account is associated with                                      |
| **[CreateOrder()](/developer/desktop-sdk/references/add-on/account-class/createorder)**                  | Creates orders for the account that need to be submitted via Submit()                                         |
| **[Denomination](/developer/desktop-sdk/references/add-on/account-class/denomination)**                  | A Currency representing the denomination currency of this connection                                          |
| **[Executions](/developer/desktop-sdk/references/strategy/execution)**                                   | A collection of executions on this account                                                                    |
| **[ExecutionUpdate](/developer/desktop-sdk/references/add-on/account-class/executionupdate)**            | Event handler for when new executions come in, an existing execution is amended, or an execution is removed   |
| **[Flatten()](/developer/desktop-sdk/references/add-on/account-class/flatten)**                          | Flattens the account on specified instrument(s)                                                               |
| **[Get()](/developer/desktop-sdk/references/add-on/account-class/get)**                                  | Returns the value of an **[AccountItem](/developer/desktop-sdk/references/add-on/account-class/accountitem)** |
| **[Name](/developer/desktop-sdk/references/add-on/account-class/name-account)**                          | A string representing the name of this account                                                                |
| **[Orders](/developer/desktop-sdk/references/add-on/account-class/orders)**                              | A collection of orders on this account                                                                        |
| **[OrderUpdate](/developer/desktop-sdk/references/add-on/account-class/orderupdate)**                    | Event handler for changes to orders                                                                           |
| **[Positions](/developer/desktop-sdk/references/strategy/positions)**                                    | A collection of positions on this account                                                                     |
| **[PositionUpdate](/developer/desktop-sdk/references/add-on/account-class/positionupdate)**              | Event handler for changes to positions                                                                        |
| **[Strategies](/developer/desktop-sdk/references/add-on/account-class/strategies)**                      | A collection of strategies on this account                                                                    |
| **[Submit()](/developer/desktop-sdk/references/add-on/account-class/submit)**                            | Submits specified order(s)                                                                                    |

## Example

```csharp
private Account myAccount;

protected override void OnStateChange()
{
    if (State == State.SetDefaults)
    {
        // Find our Sim101 account
        lock (Account.All)
            myAccount = Account.All.FirstOrDefault(a => a.Name == "Sim101");

        // Subscribe to static events. Remember to unsubscribe with -= when you are done
        Account.AccountStatusUpdate += OnAccountStatusUpdate;

        if (myAccount != null)
        {
            // Print some information about our account using the AccountItem indexer
            Print(string.Format("Account Name: {0} Connection Name: {1} Cash Value {2}",
                myAccount.Name,
                myAccount.Connection.Options.Name,
                myAccount.Get(AccountItem.CashValue, Currency.UsDollar)));

            // Print the prices of the executions on our account
            lock (myAccount.Executions)
                foreach (Execution execution in myAccount.Executions)
                    Print("Price: " + execution.Price);

            // Subscribe to events. Remember to unsubscribe with -= when you are done
            myAccount.AccountItemUpdate += OnAccountItemUpdate;
            myAccount.ExecutionUpdate += OnExecutionUpdate;
        }
    }
    else if (State == State.Terminated)
    {
        // Unsubscribe to events
        myAccount.AccountItemUpdate -= OnAccountItemUpdate;
        myAccount.ExecutionUpdate -= OnExecutionUpdate;
        Account.AccountStatusUpdate -= OnAccountStatusUpdate;
    }
}

private void OnAccountStatusUpdate(object sender, AccountStatusEventArgs e)
{
    // Do something with the account status update
}

private void OnAccountItemUpdate(object sender, AccountItemEventArgs e)
{
    // Do something with the account item update
}

private void OnExecutionUpdate(object sender, ExecutionEventArgs e)
{
    // Do something with the execution update
}
```