NinjaScript > Language Reference > Data >

High

Print this Topic Previous pageReturn to chapter overviewNext page

Definition

A collection of historical bar high prices.

 

Property Value

A DataSeries type object. Accessing this property via an index value [int barsAgo] returns a double value representing the price of the referenced bar.

 

Syntax

High
High[int barsAgo]

 

 

Examples

// OnBarUpdate method
protected override void OnBarUpdate()
{
    // Make sure we have at least 20 bars
    if (CurrentBar < 20)
        return;
 
    // Checks for higher highs
    if (High[0] > High[1] && High[1] > High[2])
         Print("Two successive higher highs");
 
    // Gets the current value of a 20 period SMA of high prices
    double value = SMA(High, 20)[0];
    Print("The value is " + value.ToString());
}