Indicators

Indicators are the input values for the signals and for some of the modules. Before you can use any indicators in your EA, you will first have to add these in the Indicator section. We advise you to give your indicators names that are easy to distinguish. By default we offer you all the standard MT4 and MT5 indicators, which you are probably already used to.

We've added a couple of predefined values, which are technically not indicators, but these can still be found at the indicator part of our platform: Open price bar, Close price bar, Low price bar, High price bar

Add an indicator

You can add an indicator to your expert advisor by clicking on the + Add button.

add a new indicator
Add a new indicator to your expert advisor

Indicator list

Now you will be presented with a list that contains all MetaTrader 4 or 5 indicators. Here you can select an existing indicator or you can upload your custom indicator.

indicator list
A list with available indicators to use in your expert advisor

Indicator parameters

Click on an indicator in the list, this will bring you to the indicator parameter page. Here you can name your indicator and set it's parameters. When done click on the Save button and you've added an indicator to your expert advisor. If you can't click Save, it means you've forgotten to enter a value.

save indicator
Modify your indicator parameters.

If you've looked carefully at the image above you may have noticed a checkbox called 'Linked'. If you've added the same indicator multiple times to your EA (with different parameter values) and you want this parameter to result into 1 EA input, then enable this checkbox. By only having 1 EA input, instead of multiple you simplify and speed up the optimization process in Metatrader.

Upload Custom Indicator

There are 2 ways to upload a custom indicator:

  • Use the 'Upload Custom Indicator' button when adding an indicator to your EA.
  • Use 'Custom Indicator' page, which you can find in the menu.

We support custom indicators in mql and ex format. Mql is the source code file and is the preferred format. But if you do not own the mql source code it is possible to upload an ex file, which will do a best effort. The system will analyze this compiled ex file to figure out which parameters this indicator uses. After uploading an ex file it is queued for analyzing, it can take a few minutes before your file is analyzed. When done, you can click on the indicator and use it in your expert advisor. To upload a custom indicator click on the Upload Custom Indicator button.

upload your custom indicator
Upload your custom indicator

Once you uploaded your indicator, you can select it at any time in the list of indicators. Custom indicators can be found at the top of the list.

Now you've uploaded your custom indicator! You've probably experimented with this indicator in MetaTrader, or you've been using it already. If not, please do so and get acquainted with your indicator. If so, we assume you know which input values you want to use and which ones are optional. However, there are 2 input values which are mandatory: the Mode and Shift parameters.

Mode

If your custom indicator has more than one possible output value (lines/ arrows/ etc.), it is important to retrieve the one you want to use in your EA. To find the correct Mode input value, you must investigate at which change of value you want to take action. There are 4 common options:

  • You're waiting for an object, like an arrow.
  • You're waiting for a colour-switch.
  • You're waiting for a line to cross a value.
  • You're waiting for a line to cross another line.
Arrows

As you know indicators can sometimes draw multiple arrows or lines. You probably use these in your manual (visual) trading feedback and decisions. Now that you continue to automate your strategy you want to select these arrows or lines as values. It's important to know an indicator exists of multiple collections of arrows or lines, for example one for the up-arrows and one for the down-arrows. Both are maintained in their own list, called 'buffers'. What you need to do is select the correct buffer for your trading strategy and enter it in the 'Mode' input when adding the indicator to your EA. If you don't know this value yet, you can use the following strategy to get this Mode value: First, remove all current indicators added to the chart, to start clean. Then, load your indicator in Metatrader. Example: let's assume you have this indicator:

custom indicator with arrows
Image 2. An arrows indicator. (1) Position/ time of the arrow. (2) Information regarding your Mode Input and indicator's value.

Note that the mouse pointer in the image above is at the up arrow. I have the Data Window open in Metatrader, as you can see on the left side of the screen. You should have the Data Window open as well. You can open it by pressing CTRL + D in Metatrader, or by finding it using the menu on top of the screen. In our example, you can see that the data window displays 2 rows (at the yellow icons). These are the 'buffers' (the collections with arrows) that the indicator is giving us, which we can use. The rows have 2 columns. The first column shows the values the indicator gives at 20:15, one bar before the bar selected. The second column shows the values the indicator gives at 20:30. One of the two rows displays a value. It's the value of the price the arrow is displayed at on the chart.

This is all the information you need to automate an EA using this indicator, because you now know:

  1. The up arrow is at Mode 0, the Down arrow is at Mode 1
  2. The arrows appear when the indicator switches from having no value, to having a value. The actual value is irrelevant when the logic condition is setup correctly (as you will see in a bit). The moment the arrow appears is also important, as you will understand in a minute when discussing Shift.

In order to use this indicator in our EA, we need to add (not upload) the indicator twice. Once for Buy (Mode 0) and once for Sell (Mode 1). Remember that every time you have an indicator which is showing multiple different outputs (arrows, lines, ...), you will need to add the indicator multiple times to your EA, for each value that you want to use. So, if you've got an indicator which shows 4 types of arrows (2 strong, 2 weak) and you want to use all 4 in your trading Signal, you will have to add the indicator 4 times. Make sure you all give them a distinguishing name, so they can be recognized easily. For example: 'Up strong', 'Up weak', 'Down strong' and 'Down weak'. Use advise to use short names.

custom indicator with arrow up
Image 3. Custom Indicator 'Arrow Up' with Mode 0
custom indicator with arrow down
Image 4. Custom Indicator 'Arrow Down' with Mode 1

Notice that Shift value '1' was set. This was necessary because the indicator will always draw the arrow on the previous bar, not on the current bar (Shift 0). The only way to know this is by watching the indicator in backtest/ demo/ live and take note. So, if the arrow is drawn on the current bar, choose shift value '0'.

Next, the Signal has to be created. The Signal will make sure the order is opened when the arrow is displayed.

custom indicator in open buy signal
Signal Open Buy
custom indicator in open sell signal
Signal Open Sell

Think about the logic behind this. As you were able to see in image 2, the value of the indicator is empty when there is no arrow and the value is not empty when the arrow is drawn. That's why we check that the value of the previous bar is equal (==) to an 'empty' value and the value of the current bar is unequal (!=) to an 'empty' value.

That's it! Your EA is ready to Export and test.

If you want to switch between Buy and Sell at the moment the arrow changes direction, you will have to make sure your Open Buy signal is exactly equal to the Close Sell signal and the Open Sell signal is exactly equal to the Close Buy signal. You can use the Copy/ Paste options for this to be sure you don't make any mistakes.

Colour switch

As you know indicators can sometimes show a line which changes colour from red to blue (or any colour) and vice versa. You probably use these in your manual (visual) trading. Now that you want to automate your strategy you want to aim at these colour switches. It's important to learn that this type of indicator sometimes exists of one collection of values, each value representing the colour, but sometimes multiple collections: one collection per colour. These collections are called 'buffers'. What you need to do is find the correct buffer for your trading strategy and enter it in the 'Mode' input of your indicator. To get the correct Mode, you need to load your indicator in Metatrader: First, remove all current indicators added to the chart, to start clean. Then add your indicator to the Metatrader chart. Now, let's assume you want to use this indicator:

custom indicator with colour
Image 5. A colour indicator. (1) Position/ time of the sell colour. (2) Information regarding your Mode Input and indicator's value.

Note that (1) is at the sell colour (red) in the image above. The Data Window is open in Metatrader, as you can see on the left side of the screen. Also, you can see that the Data Window displays 2 rows (at the yellow icons close to (2)). These are the 'buffers' that the indicator is giving and which can be used by your EA. The rows have 2 columns. The second column shows the values the indicator gives at (1), which is at 00:00. One of the two rows displays a value: the second row, which has label 'Value 2'. When you would move your mouse to the right, to the buy colour, you would see the first value is filled and the second value is empty.

This was all the information you need to automate an EA using this indicator, because you now know:

  1. Buy (blue) colour is Mode 0, Sell (red) colour is at Mode 1
  2. The colour appears when the indicator switches from having no value, to having any value. It's irrelevant which value the buffer gets, which you will understand in a bit.

In order to use this indicator in our EA, we need to add (not upload) the indicator twice. Once for Mode 0, and once for Mode 1. Remember that every time you have an indicator which is showing 2 different rows in the Data Window, you will also need to add the indicator twice. If you've got an indicator which shows 3 types of arrows (red, grey, blue), has 3 rows in the Data Window and you want to use all 3 in your Signal, you will have to add the indicator 3 times. Make sure you all give them a proper name. It's also possible the colour indicator will only have 1 buffer and the value it gets is -1 or 1 (and additionally a value for grey, which you will notice when you look at the Data Window while hovering over the colour in the chart). If this is the case, you only need to add the indicator to your EA once.

custom indicator colour blue
Image 6. Custom Indicator 'Colour Blue' with Mode 0
custom indicator colour red
Image 7. Custom Indicator 'Colour Red' with Mode 1

Next, the Signal has to be created. The Signal will make sure the order is opened when the colour is displayed.

custom indicator colour open buy
Signal Open Buy
custom indicator colour open sell
Signal Open Sell

Think about the logic behind this. As you were able to see in image 5, the value of the indicator is empty when the colour is not displayed and the value is not empty when the colour is displayed. That's why we check that the value of the previous bar is equal (==) to 'empty' value and the value of the current bar is unequal (!=) to 'empty' value.

That's it! Your EA is ready to Export and test.
While running the test I found out that the value switch isn't applied to the current bar by the indicator, but to the previous bar, so I had to change the Shift input for both custom indicators (Blue and Red) to value 1.

If you want to switch between Buy and Sell at the moment the colour changes every single time (instead of working with TP/ SL), you will have to make sure your Open Buy signal is exactly equal to the Close Sell signal and the Open Sell signal is exactly equal to the Close Buy signal.

You're waiting for a line to cross a value or
You're waiting for a line to cross another line

These types of indicators work exactly the same as the above indicators for adding arrows/ colour indicators for finding the correct Mode input. Also, you will add the indicator once for every line in the indicator you will want to use in your signal. The only difference is the Signal part, where you will have to check for a crossover to occur. Creating a crossover is explained at the Signals page.

Shift

By giving 'Shift' value 0, you select the indicator's value at the current bar. Shift 1 represents the previous bar, 2 the next bar, etc. It's important to choose the value which represents the bar on which you want to act in your Signals and Modules.

Custom indicator page

Here you can upload, download or delete your custom indicators. You can also see which custom indicator is use by which expert advisor. If you would like to delete your custom indicator make sure it is not used by any of your expert advisors or else it cannot be deleted.

custom indicator page
Add, delete or download your custom indicators

Next: Signals