Commodity Channel Index (CCI)
Previous Topic  Next Topic 

Definition

Courtesy of www.stockcharts.com
Courtesy of www.marketscreen.com

Syntax

CCI(int period)
CCI(IDataSeries inputData, int period)

Returns default value
CCI(int period)[int barsAgo]
CCI(IDataSeries inputData, int period)[int barsAgo]


Parameters

period

The number of bars to include in the calculation

inputData

Indicator source data (?)


Examples

// Prints the current value of a 20 period CCI using default price type
double value = CCI(20)[0];
Print("The current CCI value is " + value.ToString());

// Prints the current value of a 20 period CCI using high price type
double value = CCI(High, 20)[0];
Print("The current CCI value is " + value.ToString());


Source Code

You can open up the indicator source code via the NinjaScript Editor