The majority of trading systems use indicators to determine trading signals. Metatrader includes over 20 common indicators, including moving average, MACD, RSI, and stochastics. MQL has built in functions for the stock indicators. You can also use custom indicators in your expert advisor.
The moving average is most well known of the trend indicators. It shows whether the price has moved up or down over the indicator period. We have seen how to contruct the conditions of a moving average crossover. Let us examine the conditions of other trend indicators for a strategy entry and exit.
If you go to your MT4 console and you click Insert / Indicators / Trend, you get the following list of indicators:
All of these can be converted into buy and sell conditions within your expert advisors, as you shall see below.
Note on Usageif you are interested in inserting any of the code in your custom EA, you can copy and paste the extern variables into your extern variables section. Then you copy and paste the indicator calling variables somewhere within your start() function, using my templates as guide, and just below these, you can copy and paste your buy and sell conditions. Alternatively, you download and use the EAs that I have constructed around each indicator.