Close

Description

Close is a DataSeries of the type DataSeries, in which the historical closing prices are saved.

Parameter

barsAgo Index value (see Bars)

Usage

Close
Close[int barsAgo]

More Information

The returned value is dependent upon the property CalculateOnClosedBar.

Indicators are usually calculated using the closing prices.

Example

// Closing price of the current period
Print(Time[0] + " " + Close[0]);
// Closing price of the bar from 5 periods ago
Print(Time[5] + " " + Close[5]);
// Current value for the SMA 14 based on the closing prices
Print("SMA(14) calculated using the closing prices: " + Instrument.Round2TickSize(SMA(Close, 14)[0]));
// Close does not need to be mentioned since it is used by default
Print("SMA(14) calculated using the closing prices: " + Instrument.Round2TickSize(SMA(14)[0]));

Last updated