Cci_ea - page 4

 

Thank you for your efforts guys, but after backtesting your EAs, seems we still haven't found what we're looking for. Even in version which open trades on the closed bar (what for me is the best way to eliminate moments when CCI just touches 0 line very often on one candle) i see that on next bar after crossing we have several trades on one candle. Some of them are profitable, the other not. Will not be better if we open trade only once after crossing, and wait for the next cross?

 

Cci Ea

Bruno: I have been working with the CCI for quite some time now. One of the best ways to capture pips with the CCI, is to use 2 different CCI periods , like a 6 & 25 period for example.

If you take a look at my screen shot, you will see how the 6 comes up through the -100 line first, then most of the time the 25 will be coming through the +/- 100 line at the same time as the 6 is going throught the Zero line. I hope that makes sense. Here are the simple conditions for 2 CCI periods:

1) Both the 6 & 25 have to come down through the -100, and head back up through for a buy, or the 6(blue) & 25(yellow) have to come through the +100 line and head back down through for a sell.

2) The 6(blue) has to go through the -100/+100 line first.

3) Then the 6(blue)has to go through the zero line

4) Last condition is the 25(yellow)has to go through the -100/+100 line

5) BTW, the 6 & 25 generally cross at the same time. But we can play around with the parameters, and maybe chnage the 25 to a 27 period to make sure that it always crosses the -100/+100 line last.

When the 25(yellow) goes to extremes like last friday where it hit +340, then watch out because you will get a big retracement from anything over the +300/-300 area.

This is a good set up, and SuperWoodies CCI already has everything built in to it, just have to program it into an EA.

Files:
eurusd15min.bmp  2130 kb
 
codersguru:
I think the error in the CCI indicator itself!

Please find attached my version of the EA which is not better than the others.

The only advantage that I tried to collect the CCI indicator myself.

I agree, something strange with the CCI value, I try to monitor the value using Comment command, but when the value change (new tick data coming) the value don't match with the CCI value in indicator window.

Btw, Bruno I try to look at the EA again in the afternoon, since I'm at the office now and I don't have MT here coz I need to be online to test the EA.

 

Hello,

Thank you for your efforts guys, but it is necessary to be simple just with the crossing carried out of reference mark 0 of the CCI.

 
BrunoFX:
Hello, Thank you for your efforts guys, but it is necessary to be simple just with the crossing carried out of reference mark 0 of the CCI.

I just investigated what the other programmers did with this CCI.

Some of them are coded CCI not on the zero closed bar. They coded on 1 and 2 closed bar.

But most of them are inserting the CCI indicator inside the EA. Of course it is modified indicator and still CCI. EAs for Zigzag Trading system is having CCI calculated inside the EA. So may be the problem with this standard CCI and this insicator should be adapted to the EA and should be calculated inside the EA.

 

Hello,

Yes I find it really strange that it gives different result calculated manually by codersguru function (thanks for this smile) ) or calcuted by the internal mt4 funtion itself

newgidital, I think when you calculate a cross you can only do it on close bar (1 and 2) as 0 would actually fluctuate as the price of the current bar is changing.

I have done an EA as well that follow the simple rule, where you can change the method to calculate the CCI from codersguru or the internal mt4 function

->

extern int Method=0; // 0 = CCI from metatrader

or

->

extern int Method=1; // 0 = CCI from codersguru function

Cheers,

S.

Files:
cci-v1.mq4  8 kb
 

Hello Sunwest,

There are 2 errors

 

Sorry,

I think it is this line

extern double TakeProfit = 40

Just add a semi colon ->

extern double TakeProfit = 40;

I hope that is it

S.

 
sunwest:
Sorry,

I think it is this line

extern double TakeProfit = 40

Just add a semi colon ->

extern double TakeProfit = 40;

I hope that is it

S.

Hi,

you also have an error here:

else if (Method==1)

{

CCIc= CCI(CCI,1); // Current CCI from codersguru

CCIp= CCI(CCI,2); // Previous CCI from codersguru

This should be iCCI( string symbol, int timeframe, int period, int applied_price, int shift)

 

Hi,

Done, but there is an other error: CCI-V1.mq4;80:3;'}' - unbalanced parentheses

Reason: