“Various moving average convergence divergence trading strategies: a comparison”

Some studies published recently (Dejan Eric, 2009; R. Rosillo, 2013; Terence Tai-Leung Chong, 2008; Ülkü and Prodan, 2013) uncover that moving average convergence divergence (MACD) trading rules have predictive ability in many countries. The MACD trading strategies applied by these papers to execute the trading signals are various. This study analyzes the performance of a MACD trading strategy (MACD-4 in the current study), which is applied popularly by practitioners, but was not tested by prior academicians. Furthermore, the author compares the performance of each of the strategies on a group of markets to identify the best one. Before considering the costs, the author finds that the MACD-4 trading strategy has predictive ability. The best performance is MACD strategy applied by Terence Tai-Leung Chong (2008). This strategy is also the most effective one if it is applied in a high trading cost environmentm because the numbers of trades created are the lowest. Especially, the strategy applied by R. Rosillo (2013) is unpredictable in the selected samples.


Introduction
Moving average convergence divergence (MACD) is one of the most popular technical indicators.It was invented by Gerald Appel in the 1970's.MACD is calculated using two exponential moving averages and its value equals the value of the shorter period (faster) EMA less the value of the longer period (slower) EMA.Therefore, the MACD line itself always represents the distance between the two moving averages.When MACD line crosses the zero line, it is exactly at the same time when the faster EMA crosses the slower EMA.On a typical chart, the MACD shows two lines (the MACD line and the signal line), as well as the zero line.They cross each other often enough to give traders plenty of options for building various MACD crossover trend following strategies.A simplest strategy is trading on MACD line crossing the zero line that a buy signal is generated when the MACD crosses above the zero line.When the MACD crosses below the zero line, then, a sell signal is generated.MACD line crossing the signal line is another popular strategy from which a buy signal is generated when the MACD crosses above the signal line.Similarly, when the MACD line crosses below the signal line a sell signal is generated.An alternative is using the signal line instead of the MACD line and enter trades when it crosses the zero line.It is as moothed (lagged) version of the MACD line, as it is calculated as an EMA of the MACD.
Following the study of (William Brock, 1992) which tested several moving average lengths and found them useful in predicting stock prices, a numbers of studies on testing the profitability of technical trading rules Nguyen Hoang Hung, 2016.Nguyen Hoang Hung, Ph.D., Faculty of Finance and Banking, Industrial University of Ho Chi Minh City, Vietnam.have been conducted.In the field of MACD technical rules, we aware a few papers which the highlights of these are the study of Terence Tai-Leung Chong (2008) on FT30; study of Dejan Eric (2009) on the financial market of The Republic of Serbia; study of Terence Tai-Leung Chong (2010) on the BRIC countries; Ülkü and Prodan (2013) on a group of 30 countries; R. Rosillo (2013) on Spanish market companies.The MACD trading strategies which these papers apply to execute the trading signals are various.
Table 1 records the various MACD trading strategies conducted by researchers on stock markets so far.From the Table, there have been definitely three strategies for applying MACD trading rules to examine trading signals.In the study of Terence Tai-Leung Chong (2008), the MACD trading signals are examined when the MACD line crosses the zero line.For saving space, we call this strategy as MACD-1 strategy in the present paper.Another way, in the studies of Dejan Eric (2009), Terence Tai-Leung Chong (2010) and Ülkü and Prodan (2013), the MACD trading signals are generated when MACD line crosses its signal line, we call this method as MACD-2 strategy.Specially, in study of R. Rosillo  (2013), the trading signals are occurred when both MACD and signal lines cross zero line, besides MACD line crosses signal line, we call this strategy as MACD-3 strategy.By my contacts to practitioners, as well as my experience in applying MACD rules on stock markets, the MACD-3 strategy is rarely to be used by traders, because applying this strategy does not create profit for investors, and this system almost makes investors loss money in the real markets.By this system, buy signal is generated when the MACD and signal line cross below the zero line, besides signal line is greater than the MACD line.Similarly, sell signal is generated when both the MACD and signal lines cross above the zero line, besides, signal line is less than the MACD line.By its definition, MACD is calculated using two exponential moving averages and its value equals the value of the faster period EMA less the value of the slower period EMA.Therefore, the MACD line itself always represents the distance between the two moving averages.When MACD line crosses the zero line, it is exactly at the same time when the faster EMA crosses the slower EMA.Besides, signal line is a lagging of MACD, as it is calculated as an EMA of the MACD line.Consequently, at the time when MACD line crosses below the zero line and the signal line is greater than the MACD, trading signal should be a sell signal 1 , not a buy one which is determined in MACD-3 strategy.Based on this argument, we recommend the MACD-4 strategy which buy signal is generated when both the MACD and signal line cross above the zero line, besides, signal line is less than the MACD.Sell signal is generated when the MACD and signal line cross below the zero line, besides signal line is greater than the MACD.Actually, MACD-4 strategy is an opposite way of MACD-3 one, from which the "buy signal" in MACD-3 strategy becomes "sell signal" in MACD-4 strategy and the "sell signal" in MACD-3 strategy becomes the "buy signal" in MACD-4 strategy.The MACD-4 strategy have not found in academic researches so far, even though this strategy has been used popularly by traders.
In our paper, we examine the profitability of MACD-4 strategy and, then, compare the profitability of each of the four MACD trading strategies (MACD-1, MACD-2, MACD-3 and MACD-4 strategies) on a group of markets to confirm the best one.Before extracting trading costs, we find that the MACD-1 strategy has the highest powerful profitability, following is MACD-4 strategy and the lowest predictability is MACD-2 strategy.Specially, the figures show that returns created by MACD-3 strategy are unprofitable in both base and new fresh sample markets.This analysis makes three contributions to the literature: first, giving evidence to refuse the using of the MACD strategy (MACD-3 strategy) applied in the study of R. Rosillo (2013), second, examining the profitability of MACD-4 strategy which has not been noticed by previous researchers, third, comparing the profitability of each of the four MACD strategies to confirm the best one.
Data snooping problem is one of the main interests of academicians in technical analysis.According to Sullivan (1999), "data snooping happens when a set of data is used more than once for purposes of model selections".Any successful results may be got by chance because of data snooping problem.Bootstrap reality check methodology, which is applied by (Sullivan, 1999) has been used to quantify the effect of data snooping problem.However, an important issue of this method is the construction of "full universe" of technical trading rules.Sullivan (1999) assumes that rules from five simple technical trading rules represent the full set of technical trading rules.However, there may be a huge number of trading rules that may not include in their full set of trading rules.Thus, if a set of trading rules testing is a subset of a "full universe" of technical trading rules, the applying of this method may still be subject to result bias.Moreover, the present paper does not test a universe of technical trading rules, thus, the bootstrap reality check is not relevant in the current paper.
Using the most popular trading rule on the same data set is also a kind of data snooping problem.When researchers test a popular rule on a period during which it became popular, he or she is actually using the past data twice (Sullivan, 1999).MACD is invented by Gerald Appel during the late 1970's.It has become one of the most popular technical tools, thus, testing MACD ought to be kind of data snooping bias in the current research.Ülkü and  Prodan (2013) give us a way to solve this problem, just test the trading rules on the samples that the trading rules had become popular before the samples exist.They state that "If the sample covers the time period over which a technical rule has become popular, the test is subject to the survivorship bias.However, if the researcher employs an out-of-sample test of a technical rule which was already popular before the beginning of his/her sample period (i.e., become popular in the past), then the study is free of subtle form of data snooping bias".The bias sample and new fresh sample periods in the present study are from 2001 to 2012, after the MACD trading rule become popular.
In the present paper, we, first, replicate the same MACD trading strategies which are MACD-1, MACD-2, MACD-3 strategies as the original works of Terence Tai-Leung Chong (2008), Ülkü and Prodan (2013) and R. Rosillo (2013), respectively, as well as our MACD-4 trading strategy on the extending samples of Japanese, German and Russian markets which are the base sample in the study of Ülkü and Prodan (2013) 2 .Second, the frameworks are duplicated on Shanghai and Vietnamese markets which are not examined in the study of 2 Ülkü and 2 Their original samples include 30 national indexes ranged from frontier to developed markets.However, only RTS, Nikkei 225, Dax markets are chosen in the present study because the MACD trading rule has been proven to have high profitability in these markets in their study.
Prodan (2013) 3 , over the corresponding period.This step is also a procedure for a double checking of our results.To minimize the data snooping problem, some authors choose to replicate the evaluation on the more recent sample periods robust to the survivorship bias.In the current study, however, 1 the similar procedure may be not meaningful, because the time series data are not long enough.Moreover, there are many unusual events which lead to results bias happened in the January 2013-January 2015 period, such as a heavy crisis in Russia, a monetary policy intervention in Japan 4 .Those are reasons to explain why we choose to replicate 2 the framework on the new fresh data which are SSE and HOSE samples, instead of on the more recent out-of data samples.

Data and technical trading rules
1.1.Data.Our base samples include developed, emerging markets whereas our new fresh samples include emerging and frontier markets.The data are adjusted closing prices of Japanese Nikkei 225 index (Nikkei 225), German Dax index (Dax), Russian RTS index (RTS), Shanghai SSE index (SSE) and Ho Chi Minh stock index (HOSE), over the period of 2001-2012.Our base sample is longer than the original one in paper of Numan Ulkü where their base period is from 2002 to 2011.Our base samples have to meet at least two criteria: one is to try to keep as the same as the original period in the original study to attempt to link our results to those of their study, another is to ensure that the chosen period sample is as long as possible 5 .In the present paper, our main target is not testing the3 profitability of MACD trading rule.Rather, we compare the performances of each trading strategy among the four MACD ones to confirm the most profitable one.Thus, the sample chosen must meet important criteria, from which the technical trading rule used to compare must be proven to have predictability on that sample.The Nikkei 250 and DAX are developed markets where the markets are widely considered to be more efficient and less subject to problems such as political instability and government intervention than others.Importantly, the MACD trading rule to be proven to have predictability on the two markets, even though it is not statistically significant.The choosing of RTS in our research is reliable and more meaningful.The RTS index is proved to have highly statistically significant profitability with MACD trading rule.Our new fresh data samples are SSE and HOSE indexes.The SSE is an emerging market, whereas HOSE is a frontier one.The emerging and frontier markets have been proven to have high profitable power with technical analysis.Some of these studies are Gunasekarage and Power (2001) where P t is the closing level of the national index on day t, and n is the number of periods for calculating EMA.The initial EMA is the n -day simple moving average of the series.Then, MACD is computed as: Further, an EMA of the MACD line itself is computed to generate signals, and is called signal line.Accordingly, an MACD rule can be described as MACD(s, l, k) where s and l are the lag lengths of short (fast) and long (slow) EMA, respectively, and k is the lag length of the signal line.We use the most popular MACD parameters among practitioners, which is also the default parameter for technical analysis software supplied by most data vendors: MACD (12, 26, 9).

Buy and sell signals are determined as follows:
MACD-1 strategy: buy signal is generated when the MACD line crosses above the zero line.Sell signal is generated when the MACD line crosses below the zero line.MACD-2 strategy: buy signal is generated when the MACD line crosses above the signal line.Sell signal is generated when MACD line crosses below the signal line.MACD-3 strategy: buy signal is generated when both the MACD line and signal line cross below the zero line, besides signal line is greater than the MACD line.Sell signal is generated when both the MACD line and signal line cross above the zero line, besides signal line is less than the MACD line.MACD-4 strategy: buy signal is generated when both the MACD line and signal line cross above the zero line, besides signal line is less than the MACD line.Sell signal is generated when both the MACD line and signal line cross below the zero line, besides signal line is greater than the MACD line.
For the four strategies, buy and sell signals are assumed to be executed at the closing level of the day on which a cross-over takes place.Hence, returns to a signal position start to accrue the next day.In the simulation, we assume short positions upon sell signals instead of investing in the risk-free asset.By construction, the technical trader has always either a long or a short position in the market (i.e., neutral position is not permitted).Alternative constructions, such as investing in risk-free asset upon sell signals, lead to small variation in results that would not alter our results.In all the MACD trading strategies, traders are out of markets when MACD line or signal line equals zero.

Empirical results
We use t-statistic for the differences of mean daily returns from zero, obtain from bootstrap simulation by reshuffling the return series with 500 replications which is the same test as in study of Ülkü and  Prodan (2013).If the two technical trading rules have similar returns, we prefer the strategy with the least trade numbers.
Table 3 shows the signs of predictability of MACD-4 strategy.Disregarding trading costs, except for the sell return where the profit is not statistically significantly, the buy and buy minus sell results are statistically significantly profitable at 5% level in RTS market.The results are profitable, but not significant in Nikkei 225 and Dax markets.In terms of excess return, applying this strategy can create positive excess returns for investors.The mean daily excess returns are 0.00002 percent, 0.00012 percent and 0.00025 percent in RTS, Dax and Nikkei 225, respectively, on average for the three markets.Besides, the highest unconditional daily return is happened in RTS with 0.00077 percent, whereas they are 0.00006 percent and -0.00009 percent in Dax and Nikkei 225, respectively.The results reveal that the markets are more volatile in the Dax and Nikkei 225 than that in RTS during the sample period.Table 4 displays the results of the four MACD strategies.Not taking transaction costs into account.The buy minus sell return of MACD-2 strategy is significantly positive at 5% level in RTS market, whereas the positive returns are not significant in Nikkei 225 and Dax in the base sample.The results confirm that the profitability of MACD-2 trading strategy in our base sample has the same magnitude with that in the study of Ülkü and Prodan (2013) 6 .It is necessary to remind that MACD-2 strategy is exactly the MACD trading strategy applied in the study of Ülkü and Prodan (2013).This confirmation is important, because it guarantees that our results are relevant to previous researches and, thus, it allows us to compare the profitability of each strategy.The figures in the table show that the returns of MACD-3 strategy are unprofitable in all sample markets.The buy minus sell returns are significantly negative in RTS market whereas they are negative in Nikkei 225 and Dax markets.Among the three profitable MACD strategies, the highest profitable strategy is MACD-1 one, following is MACD-4 strategy and the least profitable strategy is the MACD-2 one.Indeed, the mean daily buy minus sell returns produced from MACD-1 strategy is 0.00058 percent on average whereas the MACD-2 and MACD-4 strategies produce the same mean return of 0.00038 percent.The profitability MACD-1 strategy is 20 percent higher than those of MACD-2 or MACD-4 ones.The numbers of trades generated from MACD-1 strategy is 89 whereas they are 229 and 149 for MACD-2 and MACD-4 strategies, on average, respectively.Thus, after considering the trade numbers, the performance of MACD-4 strategy is better than that of the MACD-2 strategy, and the highest performance is still MACD-1 strategy.Furthermore, the lowest numbers of trades created by MACD-1 strategy suggest traders that this trading strategy is the most effective if it is applied in a high trading cost environment.In terms of excess returns, the results have the same order.On average for the three markets, the mean daily mean excess return created from MACD-1 strategy is 0.00033 percent, whereas they are 0.00014 percent in MACD-2 and 0.00013 percent in MACD-4 strategies.Although the mean daily excess return of MACD-4 strategy is 0.00013, slightly lower than that of MACD-2 strategywith 0.00014 percent, the mean daily excess returns of MACD-4 strategy is still higher than that of the MACD-2 one, because the trade numbers generated from the MACD-2 strategy is far bigger than those from MACD-4 strategy. 1ble 5 describes the results of the four MACD trading strategies on the Shanghai stock exchange and Ho Chi Minh stock exchange.In general, on average for the two markets, the results in the new fresh sample confirm the above findings in the base sample results.Both the mean daily buy minus sell returns and mean daily excess returns produced by MACD-1 strategy are the highest, whereas those of MACD-3 strategy is significantly unprofitable.However, the predictability of MACD-2 is significantly bigger than that of MACD-4 strategy (see Table 5).This result is in slight contrast with the results in the base sample where the predictability of MACD-4 strategy isbetter than that of MACD-2 strategy (see Table 4).The reason is that there is a contrast between HOSE results and SSE results in the new fresh sample.Whereasall results from SSE market fully confirm those from base sample market, the results from HOSE do not.Indeed, figures in Table 5 reveal that the highest mean daily buy minus sell returns and mean daily excess returns are produced by MACD-2 strategy with 0.00203 percent and 0.0152 percent, respectively.Following those are those produced by MACD-4 strategy with 0.00177 percent and 0.00126 percent, respectively.The least returns are created by MACD-1 strategy with 0.00171 percent and 0.00121 percent, respectively, in HOSE market.

Conclusions
Some studies published recently Dejan Eric (2009), R. Rosillo (2013), Terence Tai-Leung Chong (2008), Ülkü and Prodan (2013) uncover that moving average convergence divergence (MACD) trading rules have predictive ability in many countries.There are several MACD trading strategies applied to execute the trading signals.This study analyzes the performance of a MACD trading strategy (MACD-4), which is applied popularly by practitioners but has not tested by prior academicians.We compare the performance of each of the strategies on a group of markets to confirm the best one.
The results reveal that the MACD-4 strategy is significantly profitable in RTS.However, the profitable returns of the strategy are not significant in Nikkei 225 and Dax.We realize that the highest profitability is earned by the MACD-1 strategy.The second is the MACD-4 strategy and the least profitability is earned bythe MACD-2 strategy, on average.Furthermore, the numbers of trades by the MACD-1 strategy is the lowest among the four strategies, and thus it implies that this strategy is the most effective one if it is used in a high trading cost environment.Especially, we find evidence to prove that MACD-3 strategy is useless in the samples.
,Bessembinder  and Chan (1995), Ming-Ming and Siok-Hwa (2006), Yu, Nartea, Gan and Yao (2013), Nguyen Hoang Hung (2013).We source Nikkei 225, Dax, RTS and SSE series data from Yahoo.com/finance whereas HOSE series data are downloaded from www.vietstock.vn,one of the most popular financial services in Vietnam.The daily returns are calculated as log differences of the samples.

Table 2 .
Statistics summary for daily returns *Notes: AC(i) refers to the i-th order autocorrelation coefficient; * implies significance at 5% level; ** implies significance at 10% level.

Table 3 .
Results of MACD-4 trading strategy

Table 4 .
Results of the four MACD trading strategies in the base sample

Table 4 (
cont.).Results of the four MACD trading strategies in the base sample Notes: * implies significance at 5% level; ** implies significance at 10% level.

Table 5 .
Results of the four MACD trading strategies in the new fresh sampleNotes: * implies significance at 5% level; ** implies significance at 10% level.