Trading signals

On the previous page (Indicators) we added all indicators. Once all indicators are added, you can create the trading signals ('signals') you want to use for the opening or closing of an order. If you want to edit your indicators, you simply go back and adjust your parameters.

Get started

Your EA always has 4 signals.

  • Open Buy
  • Open Sell
  • Close Buy
  • Close Sell

Signals are a very powerful tool to create almost any Open- and Close logic you can think of. Creating a signal may seem quite difficult in the beginning, but we believe that anyone can master building signals within a week. So let's be persistent and learn how to create signals.

You can use the “And” operator when all conditions need to be true, or the “Or” operator when any of the conditions need to be true. You can compare indicators, set up conditions or compare constant values. So far, we've been able to create almost any strategy we could imagine. If you run into a limitation of the tool, please let us know and use the contact form , or mail us on .

Enable or Disable a signal

You can enable or disable a signal by clicking on the options button and select ENABLE/DISABLE. When your signal is disabled it will not be available in the generated output (mql or compiled). The EA needs at least one enabled Open Buy or Open Sell signal to work correctly. When you disable both of the Open signals, your EA will never open an order.

  • Enabled signals appear normal with a vertical blue bar in front of the signal name.
  • Disabled signals are grayed out with a vertical gray bar in front of the signal name.
enable or disable a signal
Click the option button to ENABLE/DISABLE a signal. Disabled signals are grayed out.

Copy and Paste a signal

Open the options menu to Copy and Paste a signal to the other types of signal. A common scenario is that you start by creating the Open Buy Signal. When ready, you may want to copy the Open Buy signal to the Close Sell signal and you may want to copy the Open Sell signal to the Close Buy signal. This way the open order will switch from a buy order, to a sell order and vice versa.

  • Open the options menu for a particular signal.
  • Click Copy.
  • Open the options menu for a other signal
  • Click Paste.
copy and paste a trading signal
Click the option button to copy/paste a signal

Invert a signal

Open the options menu to invert a signal. A common scenario is that you start by creating the Open Buy Signal. When ready, you will want to create the Open Sell signal, which is the same as the Open Buy signal, but then Inverted. To do so, click the Invert button on the Open Sell signal after you copied the signal from the Open Buy signal.

invert a trading signal
Click the option button to invert the selected signal

Edit a signal

Click on a signal that you would like to edit. This will open the signal editor. If you started your EA based on a template then some signals may already contain some content. Some other signals may be blank and contain only a single node. Start building your signal from this root node.

edit a signal
Click on the signal to start editing.

Root operator

A signal has 1 logical root operator. You can choose from And/Or, the root operator cannot be removed. Start building your condition from the root operator.

  • And: All child conditions need to be true for the signal to fire.
  • Or: At least one child condition need to be true for the signal to fire.
root logical operator
A signal has 1 root operator

Add condition

Open the options menu for an operator and select condition. This option will add a condition. A condition is an expression with a left operand, an operator and a right operand. By default, the left and right operands are indicators. The indicators you've created will appear here.

add condtion
Add a condition.

Toggle Indicator, Function or Constant

You can toggle between an indicator, function or constant by clicking on the arrow next to the indicator.

  • Click on Indicator to access the indicators you have created.
  • Click on Function to access functions like ask, bid, hour, minute etc.
  • Click on Value to add a constant value. The default value is EMPTY which represents a MetaTrader empty value: 2147483647.
toggle between indicator, function and value.
Toggle between indicator, function and value

Toggle operator

You can toggle the operator category between Logical, Comparison, Crossover and Arithmetic. Each category contains different operators. Depending on the context certain operator categories may not be available. Click here for a full list of available operators.

toggle between Logical, Comparison, Crossover and Arithmetic operators
Toggle between Logical, Comparison, Crossover and Arithmetic operators

Shift (Bar)

An indicator always has a Shift (Bar) value. This is the bar on which your indicator will be calculate.

  • Shift (Bar): 0 - The current bar
  • Shift (Bar): 1 - The previous bar
  • Shift (Bar): 2 - The bar before the previous bar etc.
Select on which bar the indicator will be calculated
Select on which bar the indicator will be calculated

Add condition part

Adds a part of a condition. This option is only available for operator categories Comparison, Crossover and Arithmetic. A logical operator cannot contain a condition part.

add condtion
Add a condition part
add condtion
A condition part has been added. Here we use a constant value of 0.

Add operator

Adds an operator to the condition. It can serve as a parent operator when you are creating more complex nested conditions. Depending on the context not all operator categories may be available.

add operator
Add a operator.
operator added
An operator has been added. You can toggle this operator between Logical, Crossover and Arithmetic

Remove node

You can remove a condition by selection "Remove" under options. Operators can also be removed when they have no children attached. The root operator can never be removed.

remove node
Click remove to remove the node.

Drag-and-drop node

Rearranging the nodes is possible by using drag-and-drop. Hover over the signal, press the left mouse button, drag the node and drop it where you would like it to be.

drag-and-drop
Drag-and-drop

Invalid signals

When you are building signals you can create a signal that is invalid. Invalid signals cannot be saved. You know that your signal is invalid when you see the exclamation mark with an error message in the top summary box.

an invalid signal
Example of an invalid signal. The comparison operator is missing a condition. The comparison operator is used to compare two values and therefore needs 2 conditions. Add a condition or condition part to the Comparison operator to fix this error.

Nested conditions

You can make signals as complex as you would like. To easily understand how signals work, a good strategy is to divide them into blocks. Each block returns true or false.

complex signal
Divide signals into blocks. Each block returns true or false. We use a logical and root operator and therefore all 3 blocks need to be true for the signal to activate.

Signals can be nested. This allows you to build even more complex signals.

complex signal figure 2
In this example blue block 1,2 and 3 need to be true because the parent operator is logical AND. For blue block 3 to be true the nested signal has to be true. The nested pink signal has a OR operator and therefore at least one pink block has to be true.

Operators

The signal editor enables you with a set of well known operators. We've added a set of special crossover operators to make things easier.

SymbolNameCategory
crossoverCrossoverCrossover
crossover upCrossover from belowCrossover
crossover downCrossover from aboveCrossover
AndAndLogical
OrOrLogical
==Equal toComparison
!=Not equal toComparison
>Greater thanComparison
<Less thanComparison
+AddArithmetic
-SubstractArithmetic
/DivideArithmetic
*MultiplyArithmetic
%ModuloArithmetic

Crossover

Use this operator if the direction of the crossover does not matter.

crossover example
If MA 7 crosses over MA 30 the signal will activate. It does not matter from which direction MA 7 crosses over MA 30.

Crossover from below

Use this operator if the direction crosses over from below.

crossover from below example
If MA 7 crosses over MA 30 from below the signal will activate.

Crossover from above

Use this operator if the direction crosses over from above.

crossover from above example
If MA 7 crosses over MA 30 from above the signal will activate.

And

Logical AND operator. Apply this operator to multiple boolean conditions. Returns true if all conditions are true.

logical AND example
If the value of indicator MA 7 crosses MA30 on the previous bar from below AND ask price is larger than the previous bar of MA 7 the signal will activate.

Or

Logical OR operator. Apply this operator to multiple boolean conditions. Returns true if one or more conditions are true.

logical OR example
If the value of indicator MA 7 crosses MA30 on the previous bar from below OR ask price is larger than the previous bar of MA 7 the signal will activate.

Equal to

Comparison operator. Returns true if both sides of the expression are equal.

equal example
If the the value of indicator MA 7 is equal to the value of MA30, the signal will activate.

Not equal to

Comparison operator. Returns true if both sides of the expression are not equal.

not equal example
If the the value of indicator MA 7 is not equal to the value of MA30, the signal will activate.

Greater than

Comparison operator. Returns true if the left side of the expression is greater than the right side of the expression.

greater than example
If the value of indicator MA 7 is greater than the value of MA30, the signal will activate.

Less than

Comparison operator. Returns true if the left side of the expression is less than the right side of the expression.

less than example
If the value of indicator MA 7 is less than the value of MA30, the signal will activate.

Add

Use this operator to add numbers.

add example
If the value of indicator MA30 + 0.75 is larger than the value of MA7, the signal will activate.

Substract

Use this operator to substract numbers.

subscract example
If the value of indicator MA30 - 0.75 is larger than the value of MA7, the signal will activate.

Divide

Use this operator to divide numbers.

devide example
If the value of indicator MA30 divided by 0.75 is larger than the value of MA7, the signal will activate.

Multiply

Use this operator to multiply numbers.

multiply example
If the value of indicator MA30 multiplied by 0.75 is larger than the value of MA7, the signal will activate.

Modulo

Returns the remainder after a division.

modulo example
If the remainder of indicator MA30 % 2 = 0, the signal will activate.

Next: Modules