Previous: Part 1 : Get started.
Tutorial - Part 2: Indicators
Now we're going to add indicators to this EA.
Indicators supply the EA with the information it needs to make trading decisions, both for opening a position and closing a position. Indicators are added to the EA by you, thereby creating a library (or a 'list') of information for your EA. This list of indicators is a centralized place of information your EA will use. Once the EA uses these indicators for trading decisions and you edit one of the indicators, by changing the indicator's parameters, it will affect all of the EA's trading decisions which are using this indicator.
To add an indicator, click 'Add' on your indicators list.
You're offered to choose from all standard Metatrader indicators sorted by alphabet. If you have uploaded your own custom indicators, these will also be available on the top of the list. The number and variety of indicators you can add is unlimited.
It's a common scenario that you'll want to use the same indicator multiple times, with different parameter values. To achieve this, you will add the indicator multiple times, with different parameter values and a different name per indicator. For example you can name one indicator 'EMA 10' and another indicator 'EMA 50'.
For our EA we're going to add the "Moving Average" indicator. In fact, we will add this indicator 6 times, remember? 4 EMA's and 2 more which form the channel.
After selecting the indicator, you will see all the parameters of the indicator. You should be familiar with these parameters, because these are the same values as shown in Metatrader as inputs when adding an indicator to the chart. The values you enter here will be the values your EA will use for this indicator, at every trading decision which is using this indicator.
Let's setup the indicators:
- Moving average: Name '4 EMA', Period '4', Method 'EMA', Applied price 'Close'
- Moving average: Name '12 EMA', Period '12', Method 'EMA', Applied price 'Close'
- Moving average: Name '23 EMA', Period '23', Method 'EMA', Applied price 'Close'
- Moving average: Name '50 EMA', Period '50', Method 'EMA', Applied price 'Close'
- Moving average: Name 'High channel (EMA 10)', Period '10', Method 'EMA', Applied price 'High'
- Moving average: Name 'Low' channel (EMA 10), Period '10', Method 'EMA', Applied price 'Low'
After you've set up all 6 indicators, you'll probably have a list of indicators like this:
Next: Part 5 : Signals. Or if you're using custom indicators: Part 3 : Custom Indicators.