Use indicator in Trading Signal
The plans for finding modes helped you find your mode(s). Now use the indicator in your Buy and Sell signals. The procedure is the same for every type of indicator.
In short:
- Check all modes you intend to use when you add the indicator: modes not selected are filtered out to prevent clutter.
- Arrow: buy when the Up arrow mode is Not Equal to EMPTY.
- Color: buy when the color mode has the value of green, for example Equal 1.
- Line: buy when it crosses a level or another line, with Up Cross.
- Use Shift 1 for a signal on the last closed bar.
The 4 common types of indicator values
Section titled “The 4 common types of indicator values”Depending on the type of indicator, the signal is slightly different:
- An object, like an arrow: buy when the arrow is painted.
- A colour switch: buy when the line has a certain color.
- A line crossing a level: buy when the line crosses a value.
- A line crossing another line: buy when a fast line crosses a slow line.
Select the modes
Section titled “Select the modes”When you add the indicator to your EA, make sure all the modes you intend to use are checked. Each checked mode is an
operand in the signal editor, as Name | Mode.




How to set your signal for an arrow indicator
Section titled “How to set your signal for an arrow indicator”Now that you’ve found your modes, renamed them and selected them when adding your indicator, create the condition(s) that make your EA open and close orders.
How arrows work:
- MetaTrader paints an arrow on the chart when a mode gets a value. The arrow is placed at the value of this mode.
- An Up arrow is often painted a little under the bar and a Down arrow a little above it. That’s why the value of the mode is always a bit above or below the price.
- The value itself doesn’t matter: you only want to know if the arrow is painted. In other words: buy or sell when the mode has a value, meaning it’s not empty.
The Open Buy signal for an arrow indicator has 1 condition:
Up arrow | S1 Not Equal EMPTY (a Constant without a value): the last closed bar has an Up arrow.


Do the same for Open Sell, with the ‘Down arrow’ mode. Optionally, copy the Open Buy signal to Close Sell and the Open Sell signal to Close Buy (see Copy a signal). This way, the EA switches between buying and selling whenever the arrows change from buy to sell and vice versa.
Once you’re done, your first version of your EA is ready and you can export it. For a full tutorial, see how to run your first EA together.
How to set your signal for a color indicator
Section titled “How to set your signal for a color indicator”When MetaTrader paints a line on the chart, you may be interested in the color of the line or in the change from one color to another. There are two cases:
- 2 modes, one for each color (a Green and a Red mode): Open Buy when
Green | S1Not EqualEMPTY, the same as for arrows. - 1 mode with the color as a value (-1 is red, 1 is green, sometimes 0 is gray): Open Buy when
Color | S1Equal1.
Which case you have, you found out in the plan for finding modes: compare what you see on the chart with the Data Window or the Buffer Reader export.


For Open Sell, select the same indicator mode, but check if the value is -1. Optionally, copy the Open Buy signal to Close Sell and the Open Sell signal to Close Buy, so the EA switches whenever the color changes from red to green and vice versa.
Once you’re done, your first version of your EA is ready and you can export it. For a full tutorial, see how to run your first EA together.
How to set your signal for a line crossing a level
Section titled “How to set your signal for a line crossing a level”An oscillator such as RSI or Stochastic moves between fixed levels. A common signal is the moment the line crosses a level, for example RSI leaving the oversold zone:
RSI | S1 Up Cross 30: the RSI crossed above 30 on the last closed bar.
- For Open Sell, use the opposite:
RSI | S1Down Cross70. - Up Cross is true only on the bar of the cross. To buy as long as the line is above the level, use Above instead. See Operators.
- Use a Constant with an Input Name for the level, so you can optimize it in MetaTrader.
How to set your signal for two crossing lines
Section titled “How to set your signal for two crossing lines”A fast and a slow line crossing each other is a classic signal, for example two moving averages. Add the indicator
twice, with different settings and names (MA 7 and MA 30), then:
MA 7 | S1 Up Cross MA 30 | S1: the fast average crossed above the slow one on the last closed bar.
- For Open Sell:
MA 7 | S1Down CrossMA 30 | S1. - Indicators with two lines of their own, such as MACD (Main and Signal), work the same way: check both modes and compare them.
Using Shift when Adding Your Indicator to a Signal
Section titled “Using Shift when Adding Your Indicator to a Signal”Every indicator in a condition has a Shift (Bar): Shift 0 is the indicator’s value on the current bar, Shift 1 on the previous bar, Shift 2 on the bar before the previous bar, and so forth.
- Select the Shift of the bar at which you want to buy or sell.
- To avoid buying on an arrow on the current bar, which can still disappear (repainting), use Shift 1.
- Many arrow indicators don’t paint the current bar at all.
When our analyzer finds that a Shift never has a value, or may repaint, the picker shows a mark with a Use Shift N link. We strive for accuracy, but please do your own research: we can’t guarantee this informational warning at all times. Read more in Shift (Bar).
Related
Section titled “Related ”- Upload a Custom Indicator: find your modes
- My Indicators: upload, download or delete your custom indicators
- Trading Signals: conditions and groups
- Operators: Not Equal, Equal and Up Cross
MetaTrader is a registered trademark of MetaQuotes Ltd. EA Builder Pro is not affiliated with MetaQuotes.