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

# PriorValue

## Definition

Contains the last value of **CurrentValue**. **PriorValue** is assigned the value of **CurrentValue** immediately before **CurrentValue** is updated.

## Property Value

A **double** containing the last value contained in [CurrentValue](/developer/desktop-sdk/references/market-analyzer-column/currentvalue) before its most recent update.

## Syntax

`PriorValue`

## Examples

```csharp
protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
{
   if (marketDataUpdate.MarketDataType == MarketDataType.Last)
   {
       CurrentValue = marketDataUpdate.Price;

       // Trigger an alert if the current Last price update is greater than the previous one
       if(CurrentValue > PriorValue)
           Alert("MA Alert", Priority.High, "Check Market Analyzer", "", 30, Brushes.Black, Brushes.White);
   }
}

```