CCI Trend/Direction Indicator - page 2

 
takbir:
Is there any indicators of color cci like the picture below

I am looking for the same thing

 

Colored CCI ...

Here you go

maraxfr:
I am looking for the same thing
Files:
 

CCI trend ...

And since the name of the thread is "CCI trend" here is one that is showing CCI trend ...

Files:
cci_trend.mq4  3 kb
cci_trend.gif  30 kb
 
mladen:
And since the name of the thread is "CCI trend" here is one that is showing CCI trend ...

old produce, in you there updated..?

 

...

Take a look at the code and then tell me what does it look like :)

Attaching the "official" CCI (remember that it is "just" a CCI, from metatrader official site) so it can be compared (thoroughly of course) And I am not even using the built in CCI function ...

all the best

ZIGANI:
old produce, in you there updated..?
Files:
cci.mq4  4 kb
 
mladen:
Take a look at the code and then tell me what does it look like :)

Attaching the "official" CCI (remember that it is "just" a CCI, from metatrader official site) so it can be compared (thoroughly of course) And I am not even using the built in CCI function ...

all the best

Your code is not correct what is happening...

tour on, can (ls) double CCI_0 = iCCI(NULL, 0, VerySlowCCI, PRICE_TYPICAL, shift);

double CCI_1 = iCCI(NULL, 0, VerySlowCCI, PRICE_TYPICAL, shift+1);

double CCI_2 = iCCI(NULL, 0, VerySlowCCI, PRICE_TYPICAL, shift+2);

//*******************

int init() {

//IndicatorBuffers(4);

SetIndexStyle(0,DRAW_ARROW); SetIndexBuffer(0,sBuffer); SetIndexEmptyValue(0,0); SetIndexArrow(0,226); SetIndexLabel(0, "WPR Down");

SetIndexStyle(1,DRAW_ARROW); SetIndexBuffer(1,bBuffer); SetIndexEmptyValue(1,0); SetIndexArrow(1,225); SetIndexLabel(1, "WPR Up");

SetIndexStyle(2,DRAW_ARROW); SetIndexBuffer(2,sBuffer2); SetIndexEmptyValue(2,0); SetIndexArrow(2,226); SetIndexLabel(2, "CCI Down");

SetIndexStyle(3,DRAW_ARROW); SetIndexBuffer(3,bBuffer2); SetIndexEmptyValue(3,0); SetIndexArrow(3,225); SetIndexLabel(3, "CCI Up");

SetIndexStyle(4,DRAW_ARROW); SetIndexBuffer(4,CCI_WPR); SetIndexArrow(4,108); SetIndexLabel(4, "CCI_&_WPR_Up");

SetIndexStyle(5,DRAW_ARROW); SetIndexBuffer(5,CCI_WPR2); SetIndexArrow(5,108); SetIndexLabel(5, "CCI_&_WPR_Down");

return(0); }

int start() {

static int PrevSignal = 0, PrevTime = 0;

if(SIGNAL_BAR > 0 && Time[0] <= PrevTime) return(0);

PrevTime = Time[0];

double WPR, CCI;

for(int i=cbars;i>0;i--) { double gap = iATR(NULL,0,20,i);

WPR = iCustom(NULL, 0, "CCI_1",WPR_Per,MA_Per,0,i);

CCI = iCCI(NULL,0,cci_per,PRICE_TYPICAL,i);

if(WPR>=WPR_level) { bBuffer =Low-gap* 1; } else if(MathAbs(WPR)<=WPR_level) { sBuffer= High+gap* 1; }

if(CCI>= cci_level) { bBuffer2=Low-gap* 2; } else if(MathAbs(CCI)>= cci_level) { sBuffer2=High+gap*2; }

 
Your code is not correct what is happening... tour on, can (ls)

Since you are now expert in coding can you please show the correct code, the code above has nothing to do with what was posted by Mladen.

 
mrtools:
Since you are now expert in coding can you please show the correct code, the code above has nothing to do with what was posted by Mladen.

above note, code private messages....

 

...

Since it seems that it is not clear enough what CCI actually is : some more information about Commodity channel index (CCI) you can find at this link Commodity channel index - Wikipedia, the free encyclopedia. I hope that the link from above will help clarify what CCI actually is. Certain levels (100 and 200 namely) are used in CCI for overbought and oversold conditions, not for trend direction

________________________________

PS: the code you posted and CCI trend indicator from a few posts above I posted have nothing in common (I am not sure what does your "CCI_1" do but the one I posted is 100% sure CCI to the last letter of its definition). Also, whatever you are trying to compare, why do you need 3 values of cci when you compare just 1 - the current value (if we count out the one that is called WPR - and which is not wpr after all)? There is no need for that. All that is needed is the current value of CCI

ZIGANI:
Your code is not correct what is happening...

tour on, can (ls) double CCI_0 = iCCI(NULL, 0, VerySlowCCI, PRICE_TYPICAL, shift);

double CCI_1 = iCCI(NULL, 0, VerySlowCCI, PRICE_TYPICAL, shift+1);

double CCI_2 = iCCI(NULL, 0, VerySlowCCI, PRICE_TYPICAL, shift+2);

//*******************

int init() {

//IndicatorBuffers(4);

SetIndexStyle(0,DRAW_ARROW); SetIndexBuffer(0,sBuffer); SetIndexEmptyValue(0,0); SetIndexArrow(0,226); SetIndexLabel(0, "WPR Down");

SetIndexStyle(1,DRAW_ARROW); SetIndexBuffer(1,bBuffer); SetIndexEmptyValue(1,0); SetIndexArrow(1,225); SetIndexLabel(1, "WPR Up");

SetIndexStyle(2,DRAW_ARROW); SetIndexBuffer(2,sBuffer2); SetIndexEmptyValue(2,0); SetIndexArrow(2,226); SetIndexLabel(2, "CCI Down");

SetIndexStyle(3,DRAW_ARROW); SetIndexBuffer(3,bBuffer2); SetIndexEmptyValue(3,0); SetIndexArrow(3,225); SetIndexLabel(3, "CCI Up");

SetIndexStyle(4,DRAW_ARROW); SetIndexBuffer(4,CCI_WPR); SetIndexArrow(4,108); SetIndexLabel(4, "CCI_&_WPR_Up");

SetIndexStyle(5,DRAW_ARROW); SetIndexBuffer(5,CCI_WPR2); SetIndexArrow(5,108); SetIndexLabel(5, "CCI_&_WPR_Down");

return(0); }

int start() {

static int PrevSignal = 0, PrevTime = 0;

if(SIGNAL_BAR > 0 && Time[0] <= PrevTime) return(0);

PrevTime = Time[0];

double WPR, CCI;

for(int i=cbars;i>0;i--) { double gap = iATR(NULL,0,20,i);

WPR = iCustom(NULL, 0, "CCI_1",WPR_Per,MA_Per,0,i);

CCI = iCCI(NULL,0,cci_per,PRICE_TYPICAL,i);

if(WPR>=WPR_level) { bBuffer =Low-gap* 1; } else if(MathAbs(WPR)<=WPR_level) { sBuffer= High+gap* 1; }

if(CCI>= cci_level) { bBuffer2=Low-gap* 2; } else if(MathAbs(CCI)>= cci_level) { sBuffer2=High+gap*2; }
 

respected "mladen's" is there meaning cross(combine) it miracle (code is not complete).

sorry for my english, i' from Rassi

#property indicator_chart_window

//#property indicator_separate_window

#property indicator_buffers 6

#property indicator_color1 Red

#property indicator_color2 Lime

#property indicator_color3 Yellow

#property indicator_color4 White

#property indicator_color5 Lime

#property indicator_color6 Red

#property indicator_width1 0

#property indicator_width2 0

#property indicator_width3 0

#property indicator_width4 0

extern string _ = "WPrsettings";

extern int WPR_Per = 14 ;

//extern int MA_Per = 8 ;

extern int WPR_levelT = 5;

extern int WPR_levelB = 95;

extern double Move_Arrow = 0.3;

extern string __ = "CCisettings";

extern int cci_per = 5;

extern int cci_level = 160;

extern double Move_Arrow2 = 1.2;

extern string ___ = "settings";

extern bool SoundOn = true;

extern double Move_Arrow3 = 2.0;

double sBuffer[], sBuffer2[], bBuffer[], bBuffer2[], CCI_WPR[], CCI_WPR2[];

#define SIGNAL_BAR 1

int init() {

//IndicatorBuffers(4);

SetIndexStyle(0,DRAW_ARROW); SetIndexBuffer(0,sBuffer); SetIndexEmptyValue(0,0); SetIndexArrow(0,226); SetIndexLabel(0, "WPR Down");

SetIndexStyle(1,DRAW_ARROW); SetIndexBuffer(1,bBuffer); SetIndexEmptyValue(1,0); SetIndexArrow(1,225); SetIndexLabel(1, "WPR Up");

SetIndexStyle(2,DRAW_ARROW); SetIndexBuffer(2,sBuffer2); SetIndexEmptyValue(2,0); SetIndexArrow(2,226); SetIndexLabel(2, "CCI Down");

SetIndexStyle(3,DRAW_ARROW); SetIndexBuffer(3,bBuffer2); SetIndexEmptyValue(3,0); SetIndexArrow(3,225); SetIndexLabel(3, "CCI Up");

SetIndexStyle(4,DRAW_ARROW); SetIndexBuffer(4,CCI_WPR); SetIndexArrow(4,108); SetIndexLabel(4, "CCI_&_WPR_Up");

SetIndexStyle(5,DRAW_ARROW); SetIndexBuffer(5,CCI_WPR2); SetIndexArrow(5,108); SetIndexLabel(5, "CCI_&_WPR_Down");

return(0); }

int start() {

static int PrevSignal = 0, PrevTime = 0;

if(SIGNAL_BAR > 0 && Time[0] <= PrevTime) return(0);

PrevTime = Time[0];

double WPR, CCI;

for(int i=Bars;i>0;i--) { double gap = iATR(NULL,0,20,i);

WPR = iWPR(NULL,0,WPR_Per,i);

CCI = iCCI(NULL,0,cci_per,PRICE_TYPICAL,i);

if(WPR>=WPR_levelB) { bBuffer =Low-gap* Move_Arrow; } else if(MathAbs(WPR)<=WPR_levelT) { sBuffer= High+gap* Move_Arrow; }

if(CCI>= cci_level) { bBuffer2=Low-gap*Move_Arrow2; } else if(MathAbs(CCI)>= cci_level) { sBuffer2=High+gap*Move_Arrow2; }

if(PrevSignal <= 0) {

if(bBuffer2[SIGNAL_BAR] > 0 && SoundOn==true) {

PrevSignal = 1;

Alert("CCI_&_WPR_Up (", Symbol(), ", ", Period(), ") - <<>>"); }

if(bBuffer2[SIGNAL_BAR] > 0) CCI_WPR=Low-gap *Move_Arrow3; }

if(PrevSignal >= 0) {

if(sBuffer2[SIGNAL_BAR] > 0 && SoundOn==true) {

PrevSignal = -1;

Alert("CCI_&_WPR_Down (", Symbol(), ", ", Period(),") - <<>>"); }

if(sBuffer2[SIGNAL_BAR] > 0) CCI_WPR2=High+gap *Move_Arrow3; }

}

return(0); }

Reason: