How to add a filter for a higher time frame in TradeBuilderMT5 Expert Advisor

6 October 2018, 07:29
Sergey Deev
0
179

The TradeBuilderMT5 Expert Advisor is designed to build a trading system based on an arbitrary set of technical MT5 indicators.

Previous article: Setting a strategy for the intersection of moving averages.

In today's article, we will look at signal filtering by an indicator of a higher time frame. In the last article in the settings, we specified a time frame: CURRENT. Now, because our strategy becomes a multi time-frame, we will set a specific period for each step of the signals. We will modify the signals of OpenBuy and OpenSell. In the tester, open the input parameters tab and configure two more steps - a histogram and a MACD signal line. The result is in the figure below.

sell

Steps configured in the past lesson, we do not consider. The numbers in the picture indicate:

  1. choice of MACD indicator
  2. time interval H1
  3. function check value below argument
  4. indicator parameters according to the MACD documentation
  5. last closed bar
  6. buffer index 0 - histogram
  7. argument 0.0
  8. choice of MACD indicator
  9. H1 time frame
  10. overshoot function
  11. indicator parameters
  12. last closed bar
  13. buffer index 1 - signal line

EmptyIndicator in the next step indicates that the signal is complete.

In general, we added for the OpenSell signal: a check for finding the MACD histogram below 0 and a signal line above the histogram. Below in the figure are similar steps for the OpenBuy signal:

buy

We start the strategy tester and rejoice .. By the way, the strategy tester behaves very interesting in this situation - charts are displayed by the number of time-frames used with the display of indicators.

чарт

The set file is attached to the article.

In the next article, we will look at using CancelBuy / CancelSell signals.

Share it with friends: