Logic statement compiling error

Back to topics list To post a new topic, please log in or register
avatar
44
mickeyferrari 2016.03.04 17:20
 

Hi, 

Can anyone suggest a fix for this compiling error on the || or statement:

 if(PriceHighBack>=BolUpper && PriceMedian<BolUpper || PriceHighBack>=BolUpper && PriceMedian<PriceMedianBack)

I get this compiling error:

check operator precedence for possible error; use parentheses to clarify precedence Indicator_5MinEa_Live_Xprice.mq4 102 65

Can you suggest a fix?

hope you can help??

thanks ! Mike 

 

Note:

double PriceMedian=(High[i]+Low[i])/2;

      double PriceMedianBack=(High[i+1]+Low[i+1])/2;

      double PriceLowBack=(Low[i+1]);

      double PriceHighBack=(High[i+1]); 

avatar
2017
gooly 2016.03.04 17:27 #
 

Just set "(" and  ")"!

Is it (..&&..) || (..&&..)   or .. && (..||..) && .. ?

avatar
872
eevviill 2016.03.04 17:31 #
 
if((PriceHighBack>=BolUpper && PriceMedian<BolUpper) || (PriceHighBack>=BolUpper && PriceMedian<PriceMedianBack))

 

avatar
44
mickeyferrari 2016.03.08 16:13 #
 
thanks got it :)
Back to topics list  

To add comments, please log in or register