4-hour MACD FOREX strategy: "Double Top \ double bottom" pattern

In issue 83 of ForTrader.org, we continue to recall and re-examine the trading strategy of indicator MACD on the four-hour EURUSD chart. This time we are looking at the pattern D, which is called "Double Top and Base".

To work we will still need indicator MACD with FastEMA=5 and LowEMA=13. Also. Moving AverageThree exponential moving averages with periods of 7, 21, 365 and a simple moving average with a period of 98.

Fig. 1. Working Area of the Trading Strategy.
Fig. 1. Working Area of the Trading Strategy.

Rules of the trading strategy

So, as usual. we have two trading signals at our disposal: to buy and to sell. The traditional patterns of "Double Top and Base" will serve as an analogy. Let's look at the rules for opening trades.

Trade signal to sell

Fig. 2. The pattern "Double top". Selling.
Fig. 2. The pattern "Double top". Selling.

To successfully form a pattern to sell The first and second tops should be formed above the level of 0.0045, while the second top should be below the first one.

Searching for a sell signal

  1. The MACD histogram should make a maximum above 0.0045;
  2. After making a high above 0.0045, the histogram should form a lower high above 0.0045;
  3. The stop order is placed 10 pips above the last local high;
  4. The first target for the 30% position closes when the price is below the 21-period exponential average;
  5. The second target for half positions is closed when the price reaches a value between 89-period simple moving average and the 365-period exponential average.
  6. The third target for the remaining volume of positions is closed when the price reaches the level of price resistance.
Fig. 3. Example of a sell signal.
Fig. 3. Example of a sell signal.

Buy trade signal

Fig. 4. Double base pattern. Purchase.
Fig. 4. Double base pattern. Purchase.

For the successful formation of the pattern "Double base" to buy the first and second tops should be formed below the level of -0.0045, while the second top should be higher than the first. 

Searching for a buy signal

  1. The MACD histogram should form a minimum below -0.0045;
  2. After forming a low below -0.0045, the histogram should form a higher low below -0.0045;
  3. The stop order is placed 10 pips below the last local minimum;
  4. The first target for the 30% position closes when the price is above the 21-period exponential average;
  5. 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.
  6. The third target for the remaining volume of positions is closed when the price reaches the level of price resistance. 
Fig. 5. Example of a buy signal.
Fig. 5. Example of a buy signal.

Testing a trading strategy

We have implemented the trading robot according to the proposed rules and will test it. Note that the strategy allows us to open trades at the opening of the next bar, so we can greatly simplify the testing process.

Fig. 6. Testing the Expert Advisor using the proposed rules from January 2008 to March 2014.
Fig. 6. Testing the Expert Advisor using the proposed rules from January 2008 to March 2014.
Fig. 7. Testing result of the "Double Top and Base" pattern.
Fig. 7. Testing result of the "Double Top and Base" pattern.

As we can see, the results of this pattern are very good even without parameter optimization. Over the proposed period we have a decent profit, a fairly stable trade and low drawdown, which cannot but rejoice. Perhaps this is the most successful pattern of the system we have considered so far.

Description of Expert Advisor Parameters

Understanding that the interest in this robot will be a little more than previous ones, let's take a closer look at its parameters, so that you have the opportunity to optimize and test.

The settings of average lines for partial closing of an open position:

  • extern int perema1 = 7
  • perema2 = 21
  • persma3 = 98
  • perema4 = 365

Parameters of MACD signal levels

  • maxur45 = 0.0045
  • minur45 = -0.0045

Setting the MACD indicator parameters

  • lowema = 5
  • fastema = 13 

Restrictions settings

  • Maximum number of bars between tops/bases: stop_signal_max_bars=100
    Minimum number of bars between tops/bases: stop_signal_min_bars=0
  • Maximum height distance between vertices/bases: max_deviatoion_signal = 0.1000
  • Minimum height distance between vertices/bases: min_deviatoion_signal = 0.0000
  • Minimal TakeProfit: MinimalTakeProfit = 800
  • Number of bars to find the stoploss: stoplossbars = 7
  • Number of bars to search for takeprofit: takeprofitbars = 40 

Download the version of the advisor and see the report

We also suggest that you upload your test results for this advisor, under advisor labs (available only for registered users).

Fig. 8. Add your own trading robot statistics.
Fig. 8. Add your own trading robot statistics.

Leave a Reply

Back to top button