# 4-Hour MACD FOREX Strategy: Pattern I "Trend Continuation"

*В 20 issue of ForTrader.org magazine we will consider the next pattern of the system - pattern I "continuation of the trend".*

*Recall that we continue to consider the trading strategy "4-hour MACD FOREX strategy", which brings its author an average of 300 points per month, has been tested on historical data and works successfully on the account of the author for over two years. The strategy is based on the work on MACD patterns, as well as on combinations of moving averages.*

### Indicators used in the trading strategy

**MACD: **

- FastEMA=5
- LowEMA=13

**MovingAverage:** three exponential moving averages with periods of 7, 21, 365 and a simple moving average with a period of 98.

### Trading strategy algorithm

So, to work on the strategy we will need: the MACD indicator and four sets of moving averages. We will use the 4-hour chart of the EURUSD currency pair for our study.

The author of the strategy offers 6 different effective versions of the patterns for trading. In this issue we will test the fifth and one of the MACD continuation patterns - **continuing trend**. Pattern I.

### More about the pattern I "Trend continuation"

For a successful formation of a pattern I to sell the MACD histogram must form a minimum below -0.0015, then rise above -0.0005, without crossing the 0 level, fall below -0.0005. The pattern formed is a signal to enter the market to sell.

For a successful formation of a pattern I to buy the MACD histogram must go above 0.0015, then it must drop below 0.0005 without crossing 0, and take the value above 0.0005. The formed pattern is a signal to enter the buy market.

### Searching for a buy signal

- The MACD histogram should make a maximum above 0.0015;
- After making a low above 0.0015, the histogram should go below -0.0005 and without going below zero it should reverse above 0.0005;
- Stop Loss is placed 10 points below the last local minimum;
- The first target for the 30% position closes when the price is above the 21-period exponential average;
- The second target for half positions is closed when the price reaches a value between the 89-period simple moving average and the 365-period exponential average.
- The third target for the remaining volume of positions is closed when the price reaches the level of price resistance.

### Searching for a sell signal

- The MACD histogram should make a maximum above -0.0015;
- After making a high above -0.0015, the histogram should take a value above -0.0005 and then, without going above zero, turn down with a value below -0.0005;
- The stop loss is placed 10 pips above the last local high;
- The first target for the 30% position closes when the price is below the 21-period exponential average;
- The second target for half positions is closed when the price reaches a value between the 89-period simple moving average and the 365-period exponential average.
- The third target for the remaining volume of positions is closed when the price reaches the level of price resistance.

### Testing pattern I trading strategy

By implementing this pattern on the MQL4 language in the form of an EA, we derived the following parameters for the possibility of optimizing the strategy:

**stoplossbars**= 6 - the number of bars for which the maximum or minimum is determined to set the stop order;**takeprofitbars**= 20 - the number of bars for which there is resistance or support;**otstup**= 10 - the number of points to fall back from the found maximum or minimum when setting a stop order;**lowema**= 12 - period of the MACD indicator;**fastema**= 26 - period of the MACD indicator;**maxu**= 0.0015 - the upper level of the MACD indicator for tracking the formation of tops to sell;**maxur**= 0.0005 - lower level, crossing which forms a buy signal;**minu**= -0.0015 - the lower level of the MACD indicator for tracking the formation of the bottom to buy;**minur**= -0.0005 - the lower level of the MACD indicator, which, when crossed from top to bottom, forms a sale.

Having tested the above rules from 2001 to 2008 with the default indicator parameters, we obtained the following results:

During the whole period, the result was -$743, with a drawdown of more than $3000 when working with a constant volume of 0.1 lot.

As we see, trading according to the standard parameters of the strategy is unprofitable and not as efficient as we would like it to be. Let's try to choose the most optimal parameters of the Expert Advisor in the period from 2007.01.01 to 2008.01.01 and then check their workability in the future period up to July 2008.

### Optimization of the I-trading strategy pattern

Having tested different combinations of strategy parameters from 2007.01.01 to 2008.01.01, we got a number of profitable settings for the strategy and chose the first, in our opinion, good variant by the ratio of profitability and maximum drawdowns working for the future:

Profit: **1551.00** Number of transactions: **42** Drawdown: **561.00**

**Parameters:**

- Stoplossbars=8;
- Takeprofitbars=47;
- Otstup=47;
- Lowema=2;
- Fastema=6;
- Maxu=0.0005;
- Maxur=0.0015;
- Minu=-0.0005;
- Minur = -0.0030

Let's see what results the optimized strategy produces.

As we can see, the result is positive: the profit for this period was $1551. The initial deposit was $1000. The drawdown was $561.

In order to be sure of the effectiveness of the pattern, let's test its performance on a future period: from 2008.01.01 to 2008.07.06.

As we can see, the parameters are effective for the future: the profit was $1513 while the initial deposit was $1000, the drawdown has decreased significantly to $286. This indicates a good perspective of the system when working in the future, perhaps it is possible to find even better parameters than the ones we have chosen.

We tested the system on the hourly chart and also got good performance on the future.

The parameters for the hourly chart are as follows:

- stoplossbars=14;
- takeprofitbars=47;
- otstup=50
- lowema=24;
- fastema=4;
- maxu=0.0005;
- maxur=0.0005;
- minu=-0.0045;
- minur=-0.004.

### Let's summarize the results of testing the trading strategy

** **The strategy, according to experts of ForTrader.org magazine, is effective for working on FOREX market and with a high probability with the right approach will bring the trader profit, especially note a good ratio of profit and low potential risk when working with the parameters we found. We have not optimized the parameters of moving averages, perhaps the optimization of these parameters will also improve the result.

**Our verdict:**

Pattern I "continuation of the trend", in our opinion, is almost identical in effectiveness to Pattern D, described in issue 19 of the magazine. The particular advantage is the low drawdown, as well as the higher number of trades. We recommend this pattern for trading when finding good parameters with a future check.

We should also note that different brokers different properties of the quotes and the results of our given parameters may be different.