Pearson correlation - page 4

 

Thanks newdigital !!!

 

correlation

hi,

is there somebody here that know the list of pairs the less correlated to each other??

thanks

 

would it be possible to show the correlation numbers such as in the mataf site?

I think they would be very useful

 

Hey mladen! thanks for this awesome indicator... i have a question: im trying to use it in my EA but how do you call it with the iCustom function since the Pairs are separated by ";"...

im trying to read the values from the buffers in this way:

iCustom(NULL, NULL, "Pearson",0,24,0,EURJPY;EURUSD;EURCHF;GBPJPY;GBPUSD;USDJPY;USDCHF,Red,0,0,0,0,0,0)

but it wont work because the ";"

Thanks

 

...

Do it like this :
iCustom(NULL, NULL, "Pearson","",24,0,"EURJPY;EURUSD;EURCHF;GBPJPY;GBPUSD;USDJPY;USDCHF",0,0)

You can freely omit colors parameters since you do not need color information in the EA, so all you need is the buffer number and its shift in the end. Also first parameter should be an empty string ("")

AtApi:
Hey mladen! thanks for this awesome indicator... i have a question: im trying to use it in my EA but how do you call it with the iCustom function since the Pairs are separated by ";"...

im trying to read the values from the buffers in this way:

but it wont work because the ";"

Thanks
 

Thank you for your quick answer Mladen.. it should be fine now... off course i wont be able to see any values on back test, am i right?

Thank you very much by the way for sharing with us this great indicator!

 

at this point let me ask you another thing..i hope i dont bother you...

im trying to use your indicator to create an array of most correlated pairs and sort it (MODE_DESCEND) after that i will need the 6 most correlated pairs symbols to feed another indicator...but im stuck...

for (int i=0; i<8; i++) {

Pairsgroup1 = iCustom(NULL, NULL, "Pearson","",24,0,"EURUSD;EURJPY;GBPCAD;GBPAUD;NZDCHF;GBPUSD;GBPCHF;CADCHF",i,0) ;

Pairsgroup2 = iCustom(NULL, NULL, "Pearson","",24,0,"AUDCHF;NZDJPY;USDCHF;GBPJPY;CADJPY;AUDJPY;AUDNZD;USDJPY",i,0);

Pairsgroup3 = iCustom(NULL, NULL, "Pearson","",24,0,"CHFJPY;AUDCAD;EURNZD;NZDCAD;EURGBP;USDCAD;AUDUSD;NZDUSD",i,0);

Pairsgroup4 = iCustom(NULL, NULL, "Pearson","",24,0,"EURCHF;EURCAD;EURAUD;GBPNZD",i,0); // this will generate 4 NULL values...

// should i create another array with all the values and then sort it? (ArraySort(new_array,WHOLE_ARRAY,0,MODE_DESCEND);

// get the 6 most correlated pairs symbols

????

I may asking too much ..sorry for that but i will appreciated if someone could help me on this..

Thanks!

 

Good correlation indicator is used in Jason Fielder's DELPHI System. I used it actually also with other strategies.

Hermes

 

Pearson correlation indicator by mladen works well on large TF but shows nonsense on small TF. I fixed this issue in the modified version. Comparison of the old and new version is shown on the picture. We can see clear correlation between EURUSD and GBPUSD M5 price movement, but the original indicator fails to detect it. Modified version shows large correlation where we would expect it. On large TF, both versions show the same.

Files:
 

...

Nice work

But be careful with it. The way you done it it is shortening the calculation period in cases when there are missing bars in some of the correlated symbols (that is why you get bigger differences in the past than you can see in the present - as the missing bars number grows, the difference will grow, so, in the end, it depends on your broker data) Here is one that will not shorten the calculation period artificially but will always calculate the required correlation period (bars)

Here is a comparison of the 3 for the present : upper is your version, middle is the one from the 1st post and the lower is this version - as you can see, you will have to go way back in past (to have enough missing bars on the chart) to start to see differences in the 3 versions values (as I said, it all depends on broker data and missing bars)

arcella:
Pearson correlation indicator by mladen works well on large TF but shows nonsense on small TF. I fixed this issue in the modified version. Comparison of the old and new version is shown on the picture. We can see clear correlation between EURUSD and GBPUSD M5 price movement, but the original indicator fails to detect it. Modified version shows large correlation where we would expect it. On large TF, both versions show the same.
Files:
pearson.gif  42 kb
Reason: