i-g-cci2.mq4

i-g-cci2.mq4 download link will appear after 10 seconds.




i-g-cci2.mq4 Programming source code

#property indicator_separate_window
#property indicator_buffers 1

#property indicator_color1 Gold
extern double CCI = 14;
extern double c1= 1;
extern double c2= 1;
extern double c3= 1;

extern int    p = 6;

//---- buffers

double ExtMapBuffer1[];
double CCI1,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,max,min;


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{




SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(0,DRAW_LINE);





string short_name = "i-g-cci2";

IndicatorShortName(short_name);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
/*
int counted_bars=IndicatorCounted();

int shift=1;

RSI1=iCustom(NULL,0,"RSI",0,shift);
CCI1=iCustom(NULL,0,"CCI",0,shift);
*/

//indi();

int counted_bars=IndicatorCounted();

//---- check for possible errors

if (counted_bars<0) return(-1);

//---- last counted bar will be recounted

if (counted_bars>0) counted_bars--;

int pos=Bars-counted_bars;

int limit = Bars;
if(pos > limit) {
   pos = limit;
}

double  dResult1;

int i ;
double a[1];

//---- main calculation loop

while(pos>=0)

{
   /* correction */
   //if(pos > Bars-count-1 || pos < count+1) {
   //   pos--;
   //   continue;
   //}

/*
a1=(cci[i]-rsi[i])

a2=(cci[i-1]-rsi[i+1])-(cci[i]-rsi[i])

a3=(cci[i-2]-rsi[i+2])-(cci[i+1]-rsi[i+1])*/
/*



/* Transformation */
//========================================================================
    
  
//========================================================================


ArrayInitialize(a, EMPTY_VALUE);
ArrayResize(a, 0);
for(i=0; i