coding logic inquiry

MichaelMano

Recruit
Messages
4
is there a reason why it should be coded this way in order to get the required result

I was trying to create a condition to check if either the type of trade is position buy or sell and below is the outcome

if(OrderType() == (OP_BUY || OP_SELL)) >>>>>>> did not work properly
if(OrderType() == OP_BUY || OP_SELL) >>>>>>> did not work properly

if(OrderType() == OP_BUY || OrderType() ==OP_SELL) >>>>>>> worked properly

although I see the three have the same meaning, so I need some advice about the difference in how the system interprets the three differently

thanks
 
Top