Reading multiple pairs on single chart

Back to topics list To post a new topic, please log in or register
avatar
16
tigersoft 2016.02.05 22:21
 

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 

avatar
16
tigersoft 2016.02.05 22:22 #
 
For single pair it works. But not for multiple pairs.
avatar
Moderator
3416
GumRai 2016.02.05 23:58 #
 

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. 
avatar
16
tigersoft 2016.02.06 10:40 #
 

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. 

avatar
735
honest_knave 2016.02.06 12:43 #
 
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.

 

 

avatar
16
tigersoft 2016.02.06 19:32 #
 

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

 

avatar
735
honest_knave 2016.02.06 19:52 #
 

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

 

avatar
16
tigersoft 2016.02.06 22:50 #
 
Ok. Thanks
Back to topics list  

To add comments, please log in or register