MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Basics  Operations & Expressions  Boolean operations

 

Operand of logical negation (operation NOT displayed as exclamation mark) must be of arithmetic type. The result equals TRUE (1) if the operand value is FALSE (0); and it equals FALSE (0) if the operand differs from FALSE (0).

if(!a) Print("not 'a'");

Logical operation OR (||) of x and y values. The expression value is TRUE (1) if x or y value is true (not null). Otherwise, it is FALSE (0). Logical expressions are calculated completely, i.e., the so-called "short estimate" method does not apply to them.

if(x<0 || x>=max_bars) Print("out of range");

Logical operation AND (&&) of x and y values. The expression value is TRUE (1) if both x and y values are ture (not null). Otherwise, it is FALSE (0).

if(p!=x && p>y) Print("TRUE");