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.
Steps configured in the past lesson, we do not consider. The numbers in the picture indicate:
- choice of MACD indicator
- time interval H1
- function check value below argument
- indicator parameters according to the MACD documentation
- last closed bar
- buffer index 0 - histogram
- argument 0.0
- choice of MACD indicator
- H1 time frame
- overshoot function
- indicator parameters
- last closed bar
- 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:
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.