PriorValue

View as Markdown

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 before its most recent update.

Syntax

PriorValue

Examples

1protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
2{
3 if (marketDataUpdate.MarketDataType == MarketDataType.Last)
4 {
5 CurrentValue = marketDataUpdate.Price;
6
7 // Trigger an alert if the current Last price update is greater than the previous one
8 if(CurrentValue > PriorValue)
9 Alert("MA Alert", Priority.High, "Check Market Analyzer", "", 30, Brushes.Black, Brushes.White);
10 }
11}