> 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.

# OnAccountItemUpdate()

## Definition

An event driven method used for strategies which is called for each **AccountItem** update for the account on which the strategy is running.

**OnAccountItemUpdate()** will be called continually in real-time if a position exists on the account on which the strategy is running. This is to provide updates on the current Unrealized Profit and Loss and associated risk values.

## Method Return Value

This method does not return a value.

## Syntax

You must override the method in your strategy with the following syntax:

`protected override void OnAccountItemUpdate(Account account, AccountItem accountItem, double value)`

## Method Parameters

| Parameter       | Description                                                                                   |
| --------------- | --------------------------------------------------------------------------------------------- |
| **account**     | The [Account](/developer/desktop-sdk/references/strategy/account) updated                     |
| **accountItem** | The [AccountItem](/developer/desktop-sdk/references/add-on/account-class/accountitem) updated |
| **value**       | The value of the AccountItem updated                                                          |

## Examples

```csharp
protected override void OnAccountItemUpdate(Account account, AccountItem accountItem, double value)
{ 
   Print(string.Format("{0} {1} {2}", account.Name, accountItem, value));
   
   // output:
   // Sim101 BuyingPower 103962.5
   // Sim101 CashValue 103962.5
   // Sim101 GrossRealizedProfitLoss 3962.5
   // Sim101 RealizedProfitLoss 3962.5
}
```