Reading multiple pairs on single chart

 

Hello,

 

I am trying to read values for multiple pairs on single chart. On single chart indicator works. But when i am trying to read from more pairs on same chart so it is going wild. Do you have any idea what to do to get it to work?

   double EURH1=iHigh("EURUSD",PERIOD_CURRENT,0);
   double EURL1=iLow("EURUSD",PERIOD_CURRENT,0);
   double EURC1=iClose("EURUSD",PERIOD_CURRENT,0);
   if(EURC1 >= EURH1 ){ Alert("EURUSDHighest"); };
   if(EURC1 <= EURL1) { Alert("EURUSDLowest"); };
   
   double EURH2=iHigh("EURGBP",PERIOD_CURRENT,0);
   double EURL2=iLow("EURGBP",PERIOD_CURRENT,0);
   double EURC2=iClose("EURGBP",PERIOD_CURRENT,0);
   if(EURC2 >= EURH2 ){ Alert("EURGBPHighest"); };
   if(EURC2 <= EURL2) { Alert("EURGBPLowest"); };
   
   double EURH3=iHigh("EURJPY",PERIOD_CURRENT,0);
   double EURL3=iLow("EURJPY",PERIOD_CURRENT,0);
   double EURC3=iClose("EURJPY",PERIOD_CURRENT,0);
   if(EURC3 >= EURH3 ){ Alert("EURJPYHighest"); };
   if(EURC3 <= EURL3) { Alert("EURJPYLowest"); };

 

Thanks 

 
For single pair it works. But not for multiple pairs.
 

What does "going wild" mean?

Explain what it does do that you are not expecting.

Explain what it doesn't do that you are expecting. 
 

It is not showing correct results. It is showing High and Low results at the same.

Means reading iHigh and iLow results is the same value. 

 
tigersoft:

It is not showing correct results. It is showing High and Low results at the same.

Means reading iHigh and iLow results is the same value. 

None of your Alert statements you posted are checking for equality... so if you are basing this on not getting any alerts there may be another reason in your code.

Alternatively, you may not have data loaded for those pairs yet. Therefore both values are 0.

 

 

I am getting Alerts. But it is not of live values. It is giving Alerts example. EURUSDHighest and EURUSDLowest at same time.

 

Then I suggest you add the values into your alert statement so you can see what is going on

 
Ok. Thanks
Reason: