MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Basics  Operations & Expressions  Precedence rules

 

Each group of operations in the table has the same priority. The higher is the priority, the higher is the position of the group in the table. The precedence rules determine the grouping of operations and operands.

()     Function call                     From left to right
[]     Referencing to an array element
!      Logical negation                  From right to left
-      Sign changing operation
++     Increment
--     Decrement
~      Bitwise negation (complement)
&      Bitwise operation AND             From left to right
|      Bitwise operation OR
^      Bitwise operation exclusive OR
<<     Left shift
>>     Right shift
*      Multiplication                    From left to right
/      Division
%      Module division
+      Addition                          From left to right
-      Subtraction
<      Less than                         From left to right
<=     Less than or equal
>      Greater than
>=     Greater than or equal
==     Equal
!=     Not equal
||     Logical OR                        From left to right
&&     Logical AND                       From left to right
=      Assignment                        From right to left
+=     Assignment addition
-=     Assignment subtraction
*=     Assignment multiplication
/=     Assignment division
%=     Assignment module
>>=    Assignment right shift
<<=    Assignment left shift
&=     Assignment bitwise AND
|=     Assignment bitwise OR
^=     Assignment exclusive OR
,      Comma                             From left to right

Parentheses that have higher priority are applied to change the execution order of the operations.
Attention: Priority of performing operations in MQL4 differs to some extent from that conventional in the C language.