MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Source code library - Expert Advisors, Indicators and Scripts

SuperWoodiesCCI Indicator
SuperWoodiesCCI
Author: GODZILLA
Cross Beta ForceCross Beta Force Try product
Cross Beta Force
Author: achidayat
Subscribe to signal
FOREX NAVIGATOR
135.81%, 13 924.40 USD
MQL for "Dummies": How to Design and Construct Object Classes MQL for "Dummies": How to Design and Construct Object... Screenshot
EURUSD, H1
Demo
To post a new code, please log in or register

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

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

2012.01.17 14:26
IncCCIOnArray

IncCCIOnArray [ru]

Integer

Downloads:
276
Views:
332
Rating:
votes: 1
Files:
\MQL5\Include\IncOnArray\\MQL5\Indicators\

Description:

CCCIOnArray class is designed for calculation of Commodity Channel Index (CCI) values on indicator buffer.

Usage:

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.

Image:

Example of use of CCCIOnArray class

Translated from Russian by MetaQuotes Software Corp.
Original code: http://www.mql5.com/ru/code/649