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

# Values

## Definition

The **Values** array holds an 5 values corresponding to each **Cbi.PerformanceUnit**. **NinjaTrader** will then access the **Values** property to display the calculated performance metric in the UI. You can also access these performance metrics for a **NinjaScript** strategy.

## Syntax

`public double[] Values \{ get; private set; \}`

## Calculating Values OnAddTrade Example

```csharp
protected override void OnAddTrade(Cbi.Trade trade)
{
         Values[(int)Cbi.PerformanceUnit.Currency] += trade.ProfitCurrency;
         Values[(int)Cbi.PerformanceUnit.Percent]   = (1.0 + Values[(int)Cbi.PerformanceUnit.Percent]) * (1.0 + trade.ProfitPercent) - 1;
         Values[(int)Cbi.PerformanceUnit.Pips]     += trade.ProfitPips;
         Values[(int)Cbi.PerformanceUnit.Points]   += trade.ProfitPoints;
         Values[(int)Cbi.PerformanceUnit.Ticks]    += trade.ProfitTicks;
}

// The attribute determines the name of the performance value on the grid
[Display("MyPerformanceMetric", Order = 0)]
public double[] Values
{ get; private set; }
```

## Calculating Values On Demand Example

```csharp
// The attribute determines the name of the performance value on the grid
[Display("MyPerformanceMetric", Order = 0)]
public double[] Values
{ 
   get 
   { 
      return /*Your custom math here*/ 
   }

   private set; 
}
```