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

# AveragePrice

## Definition

Gets the average price of an account position.

## Property Value

A **double** value representing the account position's average price per unit.

## Syntax

`PositionAccount.AveragePrice`

## Examples

```csharp
protected override void OnBarUpdate()
// Raise stop loss to breakeven when there is at least 10 ticks in profit
if (Close[0] >= PositionAccount.AveragePrice + 10 * TickSize)
    ExitLongStopMarket(PositionAccount.Quantity, PositionAccount.AveragePrice);
```