Which logical statement is preferable coding?
if (OrderType() == OP_BUY && (iOpen(NULL,1,1) && iClose(NULL,1,1) < NormalizeDouble(OrderOpenPrice()-StopLoss),3)) )
result = OrderClose( OrderTicket(), OrderLots(), Bid, 50, Red );
or
if (OrderType() == OP_BUY && (iOpen(NULL,1,1) < NormalizeDouble(OrderOpenPrice()-StopLoss),3))
&& (iClose(NULL,1,1) < NormalizeDouble(OrderOpenPrice()-StopLoss),3)))
result = OrderClose( OrderTicket(), OrderLots(), Bid, 50, Red );
I'm using the first one above just fine (at least it compiles and executes trades fine), but was wondering if the second one is better or would execute differently? Any thoughts on the logical differences between the two?
if (OrderType() == OP_BUY && (iOpen(NULL,1,1) && iClose(NULL,1,1) < NormalizeDouble(OrderOpenPrice()-StopLoss),3)) )
result = OrderClose( OrderTicket(), OrderLots(), Bid, 50, Red );
or
if (OrderType() == OP_BUY && (iOpen(NULL,1,1) < NormalizeDouble(OrderOpenPrice()-StopLoss),3))
&& (iClose(NULL,1,1) < NormalizeDouble(OrderOpenPrice()-StopLoss),3)))
result = OrderClose( OrderTicket(), OrderLots(), Bid, 50, Red );
I'm using the first one above just fine (at least it compiles and executes trades fine), but was wondering if the second one is better or would execute differently? Any thoughts on the logical differences between the two?