writing cci indicator code.

 

Hi all,

please can some one tell me how to write my ea code on cci indicator.

How can i write, that if, cci 50 ( typical price)is greater than 0 on bar 1, and cci 50 (typical price)is lesser than 0 on bar 2.?

Thanks in advance.

 

the code pieces are like this:

if(iCCI(NULL,0,50,PRICE_TYPICAL,1)>0) return(1);

if(iCCI(NULL,0,50,PRICE_TYPICAL,2)<0) return(2);

i suggest you read the book on the site from beginning to the end,

good luck

 
caijs wrote >>

the code pieces are like this:

if(iCCI(NULL,0,50,PRICE_TYPICAL,1)>0) return(1);

if(iCCI(NULL,0,50,PRICE_TYPICAL,2)<0) return(2);

i suggest you read the book on the site from beginning to the end,

good luck

thanks caijs,

but with the conditions u wrote above,if i want to put it in my ea code condition, that

Place buy order if cci on bar 1 is greater than 0,and cci on bar 2 is lesser than 0,

how do i do that and what do i write in "int start " section?

thanks in advance.

 

Dear Friends, G'day

I don't whether this is right thread to post.. Sorry, if it is wrong thread.

Can anyone help me here? I want one simple Indicator where that indicator is 2 horizontal lines trails every minute with reference to low & high of the same day. I use this one as a reversal lines. Is there anything like?

Keep Charging

Be Awesome,
Raj,
DreamJOBZ.com

 

Something that has been wrecking my brain is how to break down this CCI into its mathematical formula 

iCCI(NULL, 0, CCI_Period, PRICE_TYPICAL, i);


So Starting with the typical equation


CCI = (Typical Price  -  X-period SMA of TP) / (0.015 x Mean Deviation)


How would you best code this re-arranged formula

1) Allowing you to predict the typical price of an upper overbought value of 100....

Typical Price = 20-period SMA of TP + 100 x (0.015 x Mean Deviation) <----

2) Allowing you to predict the typical price of a lower oversold value of -100
Typical Price = 20-period SMA of TP - 100 x (0.015 x Mean Deviation) <----