Skip to content

Operators

An operator compares or combines the left-hand and right-hand side of a condition. The signal editor has the well known comparison and math operators, plus special crossover operators to make things easier.

In short:

  • Crossover operators are true at the moment one value crosses the other.
  • Comparison operators are true as long as the left value is above, below or equal to the right value.
  • Mathematical operators calculate a value inside an Advanced Condition.
SymbolNameCategory
crossoverCrossCrossover
crossover upUp CrossCrossover
crossover downDown CrossCrossover
==EqualComparison
!=Not EqualComparison
>=Above or EqualComparison
<=Below or EqualComparison
>AboveComparison
<BelowComparison
+AddMathematical
-SubtractMathematical
/DivideMathematical
*MultiplyMathematical
%ModuloMathematical

The examples below use two moving averages: MA 7 (fast) and MA 30 (slow).

A crossover operator is true at the moment the left value crosses the right value, on that bar only. The diagram shows both directions: (1) MA 7 crosses MA 30 from below, (2) MA 7 crosses MA 30 from above.

Time → MA 30 MA 7 1 Up Cross MA 7 < MA 30 → ≥ 2 Down Cross MA 7 > MA 30 → ≤
Up Cross (1) and Down Cross (2). Cross is true at both moments.

Use this operator if the direction of the crossover does not matter: it is true at an Up Cross and at a Down Cross, moments (1) and (2) in the diagram.

Example: MA 7 | S1 Cross MA 30 | S1: MA 7 crosses MA 30, from below or from above.

Use this operator if the left value must cross the right value from below: moment (1) in the diagram.

Example: MA 7 | S1 Up Cross MA 30 | S1: MA 7 was below MA 30 on the bar before, and is now above or equal.

Use this operator if the left value must cross the right value from above: moment (2) in the diagram.

Example: MA 7 | S1 Down Cross MA 30 | S1: MA 7 was above MA 30 on the bar before, and is now below or equal.

A comparison operator is true as long as the left value is above, below or equal to the right value: on every bar, not only at the moment of a cross.

Comparison operator. Condition is met if both sides of the condition are equal.

Example: MA 7 | S1 Equal MA 30 | S1: the value of MA 7 is equal to the value of MA 30.

Prices and indicator values rarely are exactly equal. Equal is most useful with whole numbers, such as Hour Equal 9 or an arrow indicator Not Equal EMPTY.

Comparison operator. Condition is met if both sides of the condition are not equal.

Example: MA 7 | S1 Not Equal MA 30 | S1: the value of MA 7 is not equal to the value of MA 30.

Comparison operator. Condition is met if the left side of the condition is above or equal to the right side.

Example: MA 7 | S1 Above Or Equal MA 30 | S1: the value of MA 7 is above or equal to the value of MA 30.

Comparison operator. Condition is met if the left side of the condition is below or equal to the right side.

Example: MA 7 | S1 Below Or Equal MA 30 | S1: the value of MA 7 is below or equal to the value of MA 30.

Comparison operator. Condition is met if the left side of the condition is above the right side.

Example: MA 7 | S1 Above MA 30 | S1: the value of MA 7 is above the value of MA 30.

Comparison operator. Condition is met if the left side of the condition is below the right side.

Example: MA 7 | S1 Below MA 30 | S1: the value of MA 7 is below the value of MA 30.

A mathematical operator calculates a value from two values. You use them in an Advanced Condition (in an Operation or a Math Operator) and in the At price of a pending order.

Use this operator to add numbers, in an Advanced Condition.

Example: MA 7 | S1 Above MA 30 | S1 + 100: MA 7 is above MA 30 plus 100.

Use this operator to subtract numbers.

Example: MA 7 | S1 Above MA 30 | S1 − 100: MA 7 is above MA 30 minus 100.

Use this operator to divide numbers.

Example: MA 30 | S1 ÷ 0.75 Above MA 7 | S1: MA 30 divided by 0.75 is above MA 7.

Use this operator to multiply numbers.

Example: MA 30 | S1 × 0.75 Above MA 7 | S1: MA 30 multiplied by 0.75 is above MA 7.

Returns the remainder after a division.

Example: MA 30 | S1 % 2 Equal 0: the remainder of MA 30 divided by 2 is 0.

MetaTrader is a registered trademark of MetaQuotes Ltd. EA Builder Pro is not affiliated with MetaQuotes.