List of Operators in MQL

List of Operators in MQL

Operator Meaning
CONTAINS contains text
NOT CONTAINS does not contain text
= equals
!= not equal
~ contains regular expression
!~ does not contain regular expression
<= is less than or equal*
>= is greater than or equal*
< is less than*
> is greater than*
IN is contained in the list
NOT IN is not contained in the list
OR logical expression - or
AND logical expression - and
SORT BY sorts by element name

SORT BY Operator Modifiers

Modifier Meaning
DESC sorts in descending order
ASC sorts in ascending order
AS NATURAL sorts in natural order

Note: These sorting modifiers are used in conjunction with the SORT BY operator to determine how the results are sorted.


Additional Information:

  • Conditions are always in the form: [<element>] <operator> <value>.
  • The value does not need to be in quotes if it consists of a single alphanumeric word or a number.
  • If the element name contains non-alphanumeric characters, enclose it in square brackets, e.g., [PARAM | color] = "blue".
  • Text values and regular expressions should be enclosed in straight quotes (" "), not curly quotes (“ ”).
  • We recommend always using square brackets so that we can suggest element names for you.
2 Likes