HedgeEA - page 25

 

correlation function

extern int cPeriod = 20; // If the correlation is used to check before put new Orders

extern int Correlation_TF = PERIOD_M1;

double CorrelationIND(string Symbol1, string Symbol2, int CorrelationShift = 0) {

double u = 0, l = 0, s = 0;

for (int i = cPeriod + CorrelationShift - 1; i >= CorrelationShift ; i--) {

double Diff1 = iClose(Symbol1, Correlation_TF, i) - iMA(Symbol1, Correlation_TF, cPeriod, 0, MODE_SMA, PRICE_CLOSE, i);

double Diff2 = iClose(Symbol2, Correlation_TF, i) - iMA(Symbol2, Correlation_TF, cPeriod, 0, MODE_SMA, PRICE_CLOSE, i);

u += Diff1 * Diff2;

l += MathPow(Diff1, 2);

s += MathPow(Diff2, 2);

}

if (l * s > 0) {

return (u / MathSqrt(l * s));

}

return (0);

}
 

Correlator indicator??

I just started reading this thread, and it would appear that everyone already has a copy of the 'correlator indicator'. Could someone please post this indicator?

Thanks.

Doug

 
sprintpcic:
am trying it out on GBPUSD long USDJPY long ratio 1.17. It seems to work on both sides either close usbjpy greater or GBPUSD greater

How did you determine the ratio? I see right now that GBPUSD is 71- for 100 days.

 

I use version 5.9 i turn on useautoRatio it was displayed at the upper left corner(current ratio:1.17)

 

ofcorse it won't open trades. Your bolli setting is on a 3rd pair that your not even trading on.

No. This is default settings of the EA. It should wait until the GBP/CHF is at the bottom of the bollinger band and then open trades on the other two pairs. If it does not do this then the strategy would be destined to failure as the bollinger band pair would be representative of the movement of the two correlated pairs.

 
dcraig:
I just started reading this thread, and it would appear that everyone already has a copy of the 'correlator indicator'. Could someone please post this indicator?

Thanks.

Doug

here is the indicater but you don't need it cause its built into the new versions.

Dave

Files:
 

I've been using 5.9 with BB on the default pair on the TF15, not opening anything for the past 24 HRS, any ideas?

 

Is the latest version on the first page? has this been working better than Jugulator?

 
matrixebiz:
Is the latest version on the first page? has this been working better than Jugulator?

It was posted somewhere in this thread the version 5.9 - I do not recall which page, and it can also be retrieved from forexforums.org.

 
rhenry45:
I cannot get the version 5.7 that uses the bollinger bands to open any trades. I have it on the gbp/jpy and the chf/jpy and the pair that is set for the bollinger bands is the gbp/chf. It never opens any trades. I am using it on metatrader from alpari. I also have all of the pairs visible in the market watch window. does anyone know why this would happen?

ofcorse it won't open trades. Your bolli setting is on a 3rd pair that your not even trading on.

I am trying to run it on gbp/jpy and gbp/usd, but no trades are opening.

bolli is set to false and corralation is false too. Is there anything I need to do for it to run on gbp/usd?

reason I am trying this is both orders will have positive intrest.

Dave