Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal


IncCCIOnArray - library for MetaTrader 5

| English Русский 中文 Español Deutsch 日本語 Português

votes: 15
2012.01.17 14:26
2016.11.22 07:32

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:

  • int aPeriod - indicator period;
  • ENUM_MA_METHOD aMethod - MA calculation method.

Solve() method with the following parameters is called in the OnCalculate() function:

  • const int aRatesTotal is a rates_total variable from the OnCalculate() function parameters;
  • const int aPrevCalc - prev_calculated variable from the OnCalculate() function;
  • double aData[] - data buffer for the indicator calculation;
  • double aP[] - intermediate buffer for MA calculation;
  • double aСС[] - the buffer with CCI calculated value.

Additional methods:

  • int BarsRequired() - returns the minimum number of bars for CCI calculation;
  • string Name() - returns the line with the indicator name;

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.

Example of use of CCCIOnArray class

Translated from Russian by MetaQuotes Software Corp.
Original code:

Rabbit Rabbit

Modified version of "Rabbit" indicator having enhanced display features (the indicator displays actual support/resistance levels for any currency pair).

SilverTrend_HTF_Signal SilverTrend_HTF_Signal

SilverTrend_HTF_Signal shows a trend direction or a signal for performing a deal generated by SilverTrend_Signal indicator as a graphic object with colored trend indication or deal direction.

BrainTrend_HTF_Signal BrainTrend_HTF_Signal

BrainTrend_HTF_Signal displays trend directions from the last bars of the BrainTrend1 and BrainTrend2 as a sequence of graphical objects. The number of bars to be used is set in the input parameters.

Fine_Fractals_MTF Fine_Fractals_MTF

The indicator creates fractals from another larger timeframe on a current chart based on Fine_Fractals indicator data.