NinjaScript > Language Reference > Data >

Close

Print this Topic Previous pageReturn to chapter overviewNext page

Definition

A collection of historical bar close 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

Close
Close[int barsAgo]

 

 

Examples

// OnBarUpdate method
protected override void OnBarUpdate()
{
    // Checks if the current close is greater than the prior bar close
    if (Close[0] > Close[1])
         Print("We had an up day");
}