MQL operations
- Arithmetical Operations
Symbol
|
Operation
|
Sample
|
Alternative
|
+
|
Adding
|
x + 2
| |
-
|
Substruction or sign change
|
x - 3, y = - y
| |
*
|
Multiplication
|
3 * x
| |
/
|
piding
|
x / 5
| |
%
|
Mode operation
|
minutes = time % 60
| |
++
|
Adding 1
|
y++
|
y = y + 1
|
--
|
Substruction 1
|
y--
|
y = y - 1
|
- Assignment Operations
Symbol
|
Operation
|
Sample
|
Alternative
|
=
|
Assigining x value to y variable
|
у = x
| |
+=
|
Adding x value to y value and assigning it to y variable
|
у += x
|
y = y + x
|
-=
|
Minusing x value from y value and assigning it to y variable
|
y -= x
|
y = y - x
|
*=
|
Multiplication y and x and assigning result to y
|
y *= x
|
y = y * x
|
/=
|
piding y to x and assigning result to y
|
y /= x
|
y = y / x
|
%=
|
Mode y to x and assigning result to y
|
y %= x
|
y = y % x
|
- Relational Operations
Symbol
|
Operation
|
Sample
|
==
|
If x equal to y than returns true
|
x == y
|
!=
|
If x not equal to y than returns true
|
x != y
|
<
|
If x less than y than returns true
|
x < y
|
>
|
If x greater than y than returns true
|
x > y
|
<=
|
If x less or equal to y than returns true
|
x <= y
|
>=
|
If x greater or equal to y than returns true
|
x >= y
|
- Boolean true false operations
Symbol
|
Operation
|
Sample
|
Definition
|
!
|
Not
|
! Ñ…
|
If x value is true than it returns false
|
||
|
Or
|
x < 5 || x > 7
|
If one of two conditions is true than it returns true
|
&&
|
And
|
x == 3 && y < 5
|
Only if two conditions are true than it returns true
|
- Bit binary operations
- Comma operations
- Function calling operations
Post a Comment