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

votes: 18
2016.04.14 11:05
2016.11.22 07:32
cci_chart.mq5 (10.7 KB)view

Real author:

Yuriy Tokman (YTG)

The CCI indicator in the main chart window relative to the Moving Average indicator. The CCI indicator is shown in green, the Moving Average line is red, and the levels with the default values are shown as borders of a light gray channel.

Indicator input parameters:

//| Indicator input parameters                   |
input uint PeriodCCI=14;                              // CCI indicator period
input Smooth_Method XMA_Method=MODE_SMMA;             // Averaging method
input uint XLength=12;                                // Depth of averaging                    
input int XPhase=15;                                  // Smoothing parameter,
//---- for JJMA within the range of -100 ... +100 it influences the quality of the transition process;
//---- for VIDIA it is a CMO period, for AMA it is a slow average period
input double Dev=1.0;                                 // Channel width deviation
input ENUM_APPLIED_PRICE  Applied_price=PRICE_CLOSE;  // Price type or handle
input int  Level_CCI_UP = 100;                        // Overbought level
input int  Level_CCI_DN = -100;                       // Oversold level
input int Shift=0;                                    // Horizontal indicator shift in bars  

The indicator uses SmoothAlgorithms.mqh library classes (copy it to <terminal_data_folder>\MQL5\Include). The use of the classes was thoroughly described in the article "Averaging Price Series for Intermediate Calculations Without Using Additional Buffers".

The indicator has originally been written in MQL4 and was first published in the Code Base on 11.03.2016.

Fig.1. The CCI_Chart indicator

Fig.1. The CCI_Chart indicator

Translated from Russian by MetaQuotes Software Corp.
Original code:

The MasterWindows Library The MasterWindows Library

A library of classes for creating a user-friendly interface of your programs.

Price Price

A price label added to the right of the price with adjustable parameters.

RSI_Chart RSI_Chart

The RSI indicator in the main chart window relative to the Moving Average indicator.

WPR_Chart WPR_Chart

The WPR oscillator in the main chart window relative to the Moving Average indicator.