CCCIOnArray class is designed for calculation of Commodity Channel Index (CCI) values on indicator buffer.
Init() method with the following parameters is called in the OnInit() function:
Solve() method with the following parameters is called in the OnCalculate() function:
Test_CCIOnArray.mq5 is a sample indicator showing CCCIOnArray class application. IncCCIOnArray file must be placed to MQL5\Include\IncOnArray of the terminal data folder (IncOnArray folder must be created). CMAOnArray class from the IncMAOnArray file is needed for the proper work. It can be found here.
Commodity Channel Index Technical Indicator (CCI) measures the deviation of the commodity price from its average statistical price. High values of the index point out that the price is unusually high being compared with the average one, and low values show that the price is too low.
Translated from Russian by MetaQuotes Software Corp.
Original code: http://www.mql5.com/ru/code/649