Difference between || / &&

 

Sorry basic question I know but wondered what is the difference between using || or &&? Example for each would be:

if (OrderSymbol() == Symbol() && OrderMagicNumber() == OrderId2)
if (OrderSymbol() == Symbol() || OrderMagicNumber() == OrderId2)
 

|| means OR

&& means AND

 

if (OrderSymbol() == Symbol() && OrderMagicNumber() == OrderId2)

 means both the symbol and the magic number must match

  

if (OrderSymbol() == Symbol() || OrderMagicNumber() == OrderId2)

 means either the symbol or the magic number must match

 

Thank you, perfect answer. Furthermore, what is != ?


if (OrderType() != OP_SELL || OrderSymbol() != Symbol())


 

!= means not equal to

Take a look here for a full list of the operations 

Reason: