Indicators: Currency Correlation - page 2

 

I have been testing Correll8b for a few weeks now and am pretty impressed.  So much so that I would like to try it on cross-pairs as well. However, when I attached this indicator to some of these cross-pairs I noticed the strengths tended to correlate with each other.  After thinking about it for some time I realized this makes sense - each non USD pair had its strength calculated compared to the USD, meaning half of the weight of each non USD strength share 50% of their calculation. 

My question to you all is this:  If I want to use this indicator on EUR cross pairs, for example, will I need to edit the code so the calculations are done on EUR based pairs (EURCAD, EURGBP, EURJPY etc.)?  klakhiani - Is this what you were talking about in your previous post? Or have I overlooked something? I figured I should get confirmation on my idea before diving into another coding project. Thanks!

 
R87.FX:

I have been testing Correll8b for a few weeks now and am pretty impressed.  So much so that I would like to try it on cross-pairs as well. However, when I attached this indicator to some of these cross-pairs I noticed the strengths tended to correlate with each other.  After thinking about it for some time I realized this makes sense - each non USD pair had its strength calculated compared to the USD, meaning half of the weight of each non USD strength share 50% of their calculation. 

My question to you all is this:  If I want to use this indicator on EUR cross pairs, for example, will I need to edit the code so the calculations are done on EUR based pairs (EURCAD, EURGBP, EURJPY etc.)?  klakhiani - Is this what you were talking about in your previous post? Or have I overlooked something? I figured I should get confirmation on my idea before diving into another coding project. Thanks!

There are only three changes you need to make to change to base EUR, for instance.

//--- symbols to use
string Symbols[indicator_handles]={"EURAUD","EURCAD","EURCHF","EURUSD","EURGBP","EURJPY","EURGBP","XAUEUR"};
//--- currency labels
   string label;
   Currency[0]=label=indicator_label1;
   Currency[1]=label=indicator_label2;
   Currency[2]=label=indicator_label3;
   Currency[8]=label=indicator_label4;
   Currency[4]=label=indicator_label5;
   Currency[5]=label=indicator_label6;
   Currency[6]=label=indicator_label7;
   Currency[7]=label=indicator_label8;
   Currency[3]=label=indicator_label9;
//--- currencies to display
   IsVisible[0]=Aud;
   IsVisible[1]=Cad;
   IsVisible[2]=Chf;
   IsVisible[8]=Eur;
   IsVisible[4]=Gbp;
   IsVisible[5]=Jpy;
   IsVisible[6]=Nzd;
   IsVisible[7]=Xau;
   IsVisible[3]=Usd;
      //--- invert USD based values
      //ExtSymbol[USDCAD]*=-1; <--comment
      //ExtSymbol[USDCHF]*=-1; <--these
      //ExtSymbol[USDJPY]*=-1; <--out
      //--- calculate each currency's value



 

The difference is quite negligible though.

correlate

Files:
Correlate20.mq4  25 kb
 
Wow thank you for providing the changes! I'm also looking forward to checking out the updated version. Do you find the new Moving Average calculation to be better than the old HIGH/LOW calculation?
 
R87.FX:
Wow thank you for providing the changes! I'm also looking forward to checking out the updated version. Do you find the new Moving Average calculation to be better than the old HIGH/LOW calculation?

Percent range can still be used. Select Stochastic oscillator from the drop-down menu and make Slowing=1.

correlate

 
Ahhhh OK that makes perfect sense.  I took the edited version you provided and reversed the changes per your original post to turn in back into USD to familiarize myself with the new code.That was simple enough, but it looks like this new version calls another custom indicator "OnTick.ex4" via iCustom().   I have searched the code-base but could not find this one.  Could you please point me in the right direction to find this?  Thank you - I really appreciate your time helping me out.
 
R87.FX:
Ahhhh OK that makes perfect sense.  I took the edited version you provided and reversed the changes per your original post to turn in back into USD to familiarize myself with the new code.That was simple enough, but it looks like this new version calls another custom indicator "OnTick.ex4" via iCustom().   I have searched the code-base but could not find this one.  Could you please point me in the right direction to find this?  Thank you - I really appreciate your time helping me out.

Sure, no worries. It's included with the other file. Checks for incoming ticks from all the symbols.

correlate

 
Wow thank you!  This new versions is much cleaner!  I especially like the cleaned up buffers that only shows what it is being used.  Great work my friend.
 

Hi Ernst thaks for valuable tool. May I ask if can be add into the indicators calculation the "volume" indicator?

Thank you again and have a nice 2019.

jusiur

 

Hello,

Can you please tell me, is each currency compared to all the other 8 currencies when drawing the indicators? Or it's just USD compared to others and those are the indicators shown?

Thank you!