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 | S1AboveBands Upper | S1. - Combine conditions in groups and advanced conditions for any logic you need.
The 4 signals
Section titled “The 4 signals ”- 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 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.
Enable or disable a signal
Section titled “Enable or disable a signal”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.
The signal editor
Section titled “The signal editor ”- Click a signal in the Signals column of the EA editor. The signal editor opens.
- For an entry signal, choose the Order type: Market Order, Limit Order or Stop Order.
- Add or change the conditions (see below).
- 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.


Conditions
Section titled “Conditions”ANY | ALL Root Group
Section titled “ANY | ALL Root Group”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.
Add condition
Section titled “Add condition”- Click + (Add) on an ANY | ALL group.
- Click Add Condition. A simple condition is added at the end of the group.
- Click the left operand, the operator and the right operand to set them.


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.
Operands
Section titled “Operands ”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).
Operator
Section titled “Operator”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.
Add Advanced Condition
Section titled “Add Advanced Condition”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”


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.
Operation
Section titled “Operation”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.
Math Operator
Section titled “Math Operator”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.
Example: above yesterday’s midpoint
Section titled “Example: above yesterday’s midpoint”The Ask (price) went above the midpoint between the previous day’s High and Low: Ask Above
( High D1 | S1 + Low D1 | S1 ) ÷ 2.


Groups and nested conditions
Section titled “Groups and nested conditions ”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.


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.


Edit conditions
Section titled “Edit conditions”Every condition, advanced condition and nested group has an options menu (⋮). The root group has its own menu.


Move Up and Move Down
Section titled “Move Up and Move Down ”Move Up and Move Down move the element up or down within its group or advanced condition.
Cut, Copy and Paste
Section titled “Cut, Copy and Paste”- Click Cut (to move) or Copy (to duplicate) in the options menu of the element.
- 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.


Remove
Section titled “Remove ”Click Remove in the options menu of a condition, advanced condition or nested group. The root group can never be removed.
Invert a signal
Section titled “Invert a signal”Invert turns every condition of a signal into its opposite. Use it to create an Open Sell signal from your Open Buy signal:
- Copy the Open Buy signal to Open Sell (see Copy a signal).
- Open the Open Sell signal.
- Open the options menu of the root group and click Invert.
- Check that the inverted signal is what you expect it to be.


Copy a signal
Section titled “Copy a signal”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.
- Open the signal you want to copy.
- Click the arrow next to Save (More save options).
- Choose the target signal, for example Save As Close Sell to copy to and override Close Sell.
- Confirm to override. Your Open Buy signal is now copied to your Close Sell signal.


To copy single conditions or groups inside a signal, use Cut, Copy and Paste.
Save and invalid signals
Section titled “Save and invalid signals ”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.


Related
Section titled “Related”- Order type: Market, Limit and Stop orders
- Operands: Indicator, Function, Constant, Bar and Shift
- Operators: comparison, crossover and math
- Use indicator in Trading Signal: arrow and color indicators
MetaTrader is a registered trademark of MetaQuotes Ltd. EA Builder Pro is not affiliated with MetaQuotes.