Trading strategy "Average and MACD combo"

In the 14th issue of ForTrader.org we will look at the trading strategy "Average and MACD combo". We will need the MovingAverage indicator, MACD and ADX. The strategy is based on trend trading. The principle of the strategy is based on trying to enter the trend at the right time. The entry point is formed when the price crosses the moving averages and the MACD passes through the zero mark.

Trading strategy algorithm

1. Time period: H1-Daily;
2. instrument: Trending financial instruments;
Volume: 1 lot; (0.2, 0.4, 0.8, 1.0, etc.)
Indicators: MA with a period of 50, MA with a period of 100. MACD and with standard parameters.

A signal to buy

The price is 10 points above the MA indicator with a period of 50 and 100, the MACD is above zero. At the same time for the last five bars MACD before the signal should take value less than zero. The stop order is set at the minimum for the last five bars.

Fig.1. Example of a buy signal.
Fig.1. Example of a buy signal.

Signal to sell

Price is lower MA indicator with a period of 50 and 100 by 10 points, the MACD is below zero. At the same time for the last five bars MACD before the signal must take a value above zero. The stop order is set at the maximum for the last five bars.

Fig.2. Example of a sell signal.
Fig.2. Example of a sell signal.

Position management

After the signal appears, an order opens in whole lot.

The first target is set at the level of the doubled stop order, when the target is reached half of the position is closed. The stop order is transferred to Breakeven.

Closing a position:

The open position is completely closed by a stop order, or the remaining half of the position is closed when the price crosses the 50-period average from top to bottom by 10 pips for purchases and the price crosses the 50-period average from bottom to top by 10 pips for sales.

Strategy testing

The author of the strategy recommends trades on trending financial instruments on periods from H1 to daily chart. As the author advises, let's take the most trending currency pair at the moment - EURHKD and the daily chart. The lot size for trading is 0.2. Initial deposit $10,000.

Having tested the above rules from 1999.07.27 to 2007, we obtained the following results (According to opening prices):

  • Net profit -559.11
  • Maximum drawdown 5452.53 (49.42%)
  • Total transactions 39
  • Continuous Loss 2
Fig. 3. Testing on EURHKD. Daily.
Fig. 3. Testing on EURHKD. Daily.

Probably, the author of this strategy was too optimistic about the effectiveness of this strategy. If we open the graph of the currency pair EURHKD, we see how the strategy passed good trend movements and exits were too early. In our opinion, trading by ordinary line crossover would give a better result here. But, nevertheless, as usual we will try to turn the situation for the better and try to find the best strategy parameters to work on this currency pair.

Let's describe the parameters of the Expert Advisor:

  • FastEMA, SlowEMA - MACD indicator settings;
  • Predel - the number of bars for counting the MACD histogram exit beyond the zero mark;
  • SMA1, SMA2 - moving average periods;
  • Otstup - the price indent after which the trade is entered;
  • Stoplossbarr - the number of bars for which the stop order is calculated;
  • Pprofitum - multiplication factor for calculating the profit level;
  • enable - enables the ADX filter. 0 - off, 1 - on;
  • periodADX - the period of the ADX indicator.

We chose the following parameters:

  • FastEMA=39
  • SlowEMA=33
  • predel=3
  • SMA1=10 SMA2=10
  • otstup=81
  • stoplossbars=86
  • pprofitum=2
  • enable=0
  • periodADX=14

We got the following result:

  • Net profit 27897.09
  • Maximum drawdown 3603.11 (19.03%)
  • There are 6 deals in total
  • Continuous loss 0
Fig. 4. Result of operation of the selected parameters in the period from 1999.07.27 to 2007.01.11
Fig. 4. Result of operation of the selected parameters in the period from 1999.07.27 to 2007.01.11

The most optimal result obtained with fewer trades and the removal of one of the lines of the average. As we can see, they have the same periods, which indicates that one of the lines is redundant and is the key factor causing deterioration of the strategy. As we can see, we have also reduced the number of bars allowed before the MACD signal appears - parameter predel=3. Decrease in the period of averages by a factor of 10 is a consequence of lagging averages with the parameter 100, which has also had a negative impact on the trend following. The calculation index has increased significantly stop orderNow instead of 5 bars the stop is calculated on 86 bars, indicating that the strategy needs to reconsider the size of the stop order. Having thus moved apart the Stoplossbarr parameter, the Expert Advisor only identified local minimums and maximums, and set stop orders at these levels.

Let's check the stability of the strategy results for the future period: from 2007.01.11 to the current time (the selection of optimal parameters in this area was not performed).

Fig. 5. Operation of the system of optical parameters at the site from 2008.01.11 to 2008.05.21.
Fig. 5. Operation of the system of optical parameters at the site from 2008.01.11 to 2008.05.21.

The test for the future showed good results. Several more positive deals were made. Net profit for the whole period increased to 37485.88. The system drawdown did not increase and was 3603.20 (19.03%)

To summarize

So, the strategy investigated by ForTrader.org magazine did not show itself in the best light when tested. The author also described the possibility of using the ADX momentum check as an entry filter.

As we have repeatedly seen, there can be no universal parameters for indicator-based strategies. Every currency pair has its own technical component and its own unique price character. We recommend you to study the strategy thoroughly before using it in your trading account. Best wishes, your ForTrader.org.

Leave a Reply

Back to top button