Skip to content

Trading Signals

A trading signal (“signal”) decides when your EA opens or closes an order. A signal is a group of conditions which have to be met before an order is opened or closed.

In short:

  • Your EA has 4 signals: Open Buy and Open Sell (entry), Close Buy and Close Sell (exit).
  • An entry signal has an Order type: Market, Limit or Stop.
  • A signal starts with an ANY | ALL group: any or all of its conditions must be met.
  • A condition compares two operands with an operator: Close | S1 Above Bands Upper | S1.
  • Combine conditions in groups and advanced conditions for any logic you need.
  • Open Buy (entry): opens a buy order when its conditions are met
  • Open Sell (entry): opens a sell order when its conditions are met
  • Close Buy (exit): closes open buy orders when its conditions are met
  • Close Sell (exit): closes open sell orders when its conditions are met
Signals column with Entry (Open Buy, Open Sell) and Exit (Close Buy, Close Sell), each with an on/off switchSignals column with Entry (Open Buy, Open Sell) and Exit (Close Buy, Close Sell), each with an on/off switch
The Signals column of the EA editor: Open Buy and Open Sell are on, Close Buy and Close Sell are off.

Signals are a very powerful tool to create almost any open and close logic you can think of. They may seem difficult at first, but anyone can learn them: be persistent.

Click the switch next to a signal to enable or disable it.

  • Enabled: the switch is blue with a checkmark icon.
  • Disabled: the switch is grayed out with a dash icon: “Off · not in your EA”. The signal is not included in the generated EA (mql or compiled).

The EA needs at least one enabled Open Buy or Open Sell signal to open orders automatically. You can leave both Open signals disabled if you plan to open your orders manually.

  1. Click a signal in the Signals column of the EA editor. The signal editor opens.
  2. For an entry signal, choose the Order type: Market Order, Limit Order or Stop Order.
  3. Add or change the conditions (see below).
  4. Click Save.

If you started your EA from a template, your signals may already contain conditions. Other signals only contain an empty root group: start by adding conditions to it.

Signal editor with Order type Market Order and an ALL group with three conditionsSignal editor with Order type Market Order and an ALL group with three conditions
The Open Buy signal of the Bollinger Bands template: an ALL group with three conditions.

Every signal starts with a root group. The ANY | ALL choice applies to all conditions directly in this group:

  • ANY: one of the conditions has to be met for the signal to activate.
  • ALL: all of the conditions have to be met for the signal to activate.

Build your conditions from this root group. It can’t be removed.

  1. Click + (Add) on an ANY | ALL group.
  2. Click Add Condition. A simple condition is added at the end of the group.
  3. Click the left operand, the operator and the right operand to set them.
Add menu of the root group with Add Condition, Add Advanced Condition and Add GroupAdd menu of the root group with Add Condition, Add Advanced Condition and Add Group
The Add menu of a group: Add Condition, Add Advanced Condition and Add Group.

A condition is an expression with a left-hand side, an operator and a right-hand side. A new condition starts with an indicator of your EA. In an EA without indicators it starts with a Bar operand, Close | S1.

Click the left or right side of a condition: a picker opens, and at the top you choose the kind of operand. Every kind is explained on Operands.

  • Indicator: a line or arrow (mode) of an indicator you added to your EA, with its Shift, for example Bands Upper | S1.
  • Function: a built-in value (prices, account, date and time, order values), for example Ask, Hour.
  • Constant: a fixed value, optionally an input in MetaTrader, for example 30.
  • Bar: the Open, High, Low or Close of a bar, with its Shift, for example High H1 | S1.

The Shift (Bar) of an Indicator or Bar is which bar’s value you use: 0 the current bar, 1 the previous bar, 2 the bar before the previous bar, etc. See Shift (Bar).

There are three operator categories:

  • Comparison (Above, Above Or Equal, Below, Below Or Equal, Equal, Not Equal): whether one value is above, below or equal to the other
  • Crossover (Cross, Up Cross, Down Cross): whether one value crossed the other
  • Mathematical (Add, Subtract, Multiply, Divide, Modulo): calculates a value, in an Advanced Condition

Depending on the context, some categories are not available. See all operators.

When a simple condition is not enough, add an Advanced Condition: click + on a group, then Add Advanced Condition. Here you can calculate with values, for example a midpoint or a distance.

An Advanced Condition has an operator at the top (Above, Below, Cross, …) and two sides under it: the first item is the left-hand side, the second the right-hand side. You build each side from these elements:

  • Value: one operand: Indicator, Function, Constant or Bar
  • Operation: two values with a math operator between them, such as High + Low
  • Math Operator: a group that calculates all its items with one math operator, such as “Divide all of the following”
New Advanced Condition with the operator Equal and two sides with Operation, Value and Math OperatorNew Advanced Condition with the operator Equal and two sides with Operation, Value and Math Operator
A new Advanced Condition: define the left-hand and right-hand side to complete it.

A single operand, exactly like a side of a simple condition: an Indicator, Function, Constant or Bar. Click it to pick one. See Operands.

Example: Ask, or the Constant 2.

Two values with a math operator between them: Add, Subtract, Multiply, Divide or Modulo. Click each value and the operator to set them.

Example: High D1 | S1 + Add Low D1 | S1: the High plus the Low of the previous day.

A group with one math operator that calculates all of its items, from top to bottom: “Divide all of the following”. Each item is again a Value, an Operation or another Math Operator, so you can nest calculations.

Example: Divide all of the following: (High D1 | S1 + Low D1 | S1), 2. That is the High plus the Low, divided by 2: the midpoint of the previous day.

The Ask (price) went above the midpoint between the previous day’s High and Low: Ask Above ( High D1 | S1 + Low D1 | S1 ) ÷ 2.

Advanced Condition Above with Ask, and Divide all of the following: High D1 S1 plus Low D1 S1, and 2Advanced Condition Above with Ask, and Divide all of the following: High D1 S1 plus Low D1 S1, and 2
Above: the Ask (Value) on the left, and on the right a Math Operator Divide with an Operation (High D1 | S1 + Low D1 | S1) and the Constant 2.

Add a nested group to combine conditions with their own ANY or ALL: click + on a group, then Add Group. In the new group, add Conditions, Advanced Conditions or another nested group.

Signal with an empty nested ANY ALL group under the conditionsSignal with an empty nested ANY ALL group under the conditions
A nested ANY | ALL group at the end of the root group. It is empty until you add items with +.

You can make signals as complex as you like. To keep them easy to understand, divide them into groups: each group is either met or not met.

Example: an ALL root group with 2 conditions and a nested ANY group with 2 conditions.

  • Root group (ALL): Condition A, Condition B, nested group. Met when A and B and the nested group are met.
  • Nested group (ANY): Condition C, Condition D. Met when C or D is met.

The signal activates when A and B are met, and at least 1 of C and D.

A real example, the Open Buy signal of the Cowabunga EA: an ALL root group with 4 conditions and a nested ANY group. The ANY group has a condition and another group, an ALL group with 3 conditions. Each nested group is indented, with a line in its own color. See Build an EA with EA Builder Pro.

Open Buy signal with an ALL root group of 4 conditions and a nested ANY group that holds an MACD Up Cross condition and an ALL group of 3 MACD conditionsOpen Buy signal with an ALL root group of 4 conditions and a nested ANY group that holds an MACD Up Cross condition and an ALL group of 3 MACD conditions
Divide signals into groups. The root group is an ALL group, so all 4 conditions must be met, and the nested ANY group: an Up Cross of MACD, or all 3 conditions of the ALL group in it.

Every condition, advanced condition and nested group has an options menu (⋮). The root group has its own menu.

Options menu of a condition with Copy, Cut, Paste, Move Up, Move Down and RemoveOptions menu of a condition with Copy, Cut, Paste, Move Up, Move Down and Remove
The options menu of a condition: Copy, Cut, Paste, Move Up, Move Down and Remove.

Move Up and Move Down move the element up or down within its group or advanced condition.

  1. Click Cut (to move) or Copy (to duplicate) in the options menu of the element.
  2. Open the options menu of the group where it must go and click Paste. It is added at the end of that group.
  • A cut element is grayed out until you paste it, with an undo button to cancel.
  • Replace, in the menu of the root group: after you copied or cut an ANY | ALL group, it replaces the whole signal with that group, after you confirm.
Signal with a grayed-out cut condition and an open options menu with Paste enabledSignal with a grayed-out cut condition and an open options menu with Paste enabled
The first condition is cut (grayed out, with an undo button); Paste in an options menu moves it there.

Click Remove in the options menu of a condition, advanced condition or nested group. The root group can never be removed.

Invert turns every condition of a signal into its opposite. Use it to create an Open Sell signal from your Open Buy signal:

  1. Copy the Open Buy signal to Open Sell (see Copy a signal).
  2. Open the Open Sell signal.
  3. Open the options menu of the root group and click Invert.
  4. Check that the inverted signal is what you expect it to be.
Options menu of the root group with Invert, Copy, Paste and ReplaceOptions menu of the root group with Invert, Copy, Paste and Replace
The options menu of the root group: Invert, Copy, Paste and Replace.

A common scenario: you build the Open Buy signal first, then copy it to Close Sell, and copy Open Sell to Close Buy. The open order then reverses from a buy order to a sell order and vice versa.

  1. Open the signal you want to copy.
  2. Click the arrow next to Save (More save options).
  3. Choose the target signal, for example Save As Close Sell to copy to and override Close Sell.
  4. Confirm to override. Your Open Buy signal is now copied to your Close Sell signal.
Menu next to Save with Save As Open Buy, Save As Open Sell, Save As Close Buy and Save As Close SellMenu next to Save with Save As Open Buy, Save As Open Sell, Save As Close Buy and Save As Close Sell
Save As copies the open signal to another signal. The signal itself is grayed out.

To copy single conditions or groups inside a signal, use Cut, Copy and Paste.

Click Save to save the signal. While you build a signal, it can be invalid, for example when an Advanced Condition has no left-hand or right-hand side yet.

  • An error message shows at the top of the signal, with Show to bring the first error into view.
  • The element with the error is marked with an error icon.
  • Save does not save an invalid signal: it shows the errors instead. Fix them, then save.
  • Save As is not available while the signal is invalid.
  • When you close the editor with unsaved changes, you are asked whether to discard them.
Signal with the error message Advanced Condition: Left-Hand side and Right-Hand side are requiredSignal with the error message Advanced Condition: Left-Hand side and Right-Hand side are required
An Advanced Condition is missing a left-hand and right-hand side. Add those elements to fix this error.

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