Why this code gives operator precedence error?

 
        if(NormalizeDouble(price_140-Move_step*pm*Point,Digits)>NewPrice
         && NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits)
         || price_116==0.0
         || Open_order_on_trend && CountBuys==0 
         || NewPrice>=NormalizeDouble(price_108+Distance_between_orders*pm*Point,Digits)
         || NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits))
 
rod777:
        if(NormalizeDouble(price_140-Move_step*pm*Point,Digits)>NewPrice
         && NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits)
         || price_116==0.0
         || Open_order_on_trend && CountBuys==0 
         || NewPrice>=NormalizeDouble(price_108+Distance_between_orders*pm*Point,Digits)
         || NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits))

You're missing a set of parenthesis. I can't tell you where because it's your logic so you need to determine the correct precedence. 

 
rod777:
 if(A && B || C || D && E || F || G)
Don't mix ands and ors together. Add parentheses to make it specific.
bool A = NormalizeDouble(price_140-Move_step*pm*Point,Digits)>NewPrice;
bool B = NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits);
bool C = price_116==0.0;
bool D = Open_order_on_trend;
bool E = CountBuys==0;
bool F = NewPrice>=NormalizeDouble(price_108+Distance_between_orders*pm*Point,Digits);
bool G = NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits);

if(A && (B || C || D) && (E || F || G) )
// or
if( (A && B) || C || (D && E) || F || G)
 
thanks
 
it works, was the first one
Reason: