^{1}

^{1}

With the rapid development of the financial market, many professional traders use technical indicators to analyze the stock market. As one of these technical indicators, moving average convergence divergence (MACD) is widely applied by many investors. MACD is a momentum indicator derived from the exponential moving average (EMA) or exponentially weighted moving average (EWMA), which reacts more significantly to recent price changes than the

Securities investment is a financial activity influenced by many factors such as politics, economy, and psychology of investors. Its process of change is nonlinear and multifractal [

Asness [

We will introduce the concept of moving average convergence divergence (MACD) and help the readers understand its principle and application in Section

MACD evolved from the exponential moving average (EMA), which was proposed by Gerald Appel in the 1970s. It is a common indicator in stock analysis. The standard MACD is the 12-day EMA subtracted by the 26-day EMA, which is also called the DIF. The MACD histogram, which was developed by T. Aspray in 1986, measures the signed distance between the MACD and its signal line calculated using the 9-day EMA of the MACD, which is called the DEA. Similar to the MACD, the MACD histogram is an oscillator that fluctuates above and below the zero line. The construction formula is as follows:

(i) Calculate the values of DIF and DEA.

(ii) When DIF and DEA are positive, the MACD line cuts the signal line in the uptrend, and the divergence is positive, there is a buy signal confirmation.

(iii) When DIF and DEA are negative, the signal line cuts the MACD line in the downtrend, and the divergence is negative, there is a sell signal confirmation.

The essence of a good technical indicator is a smooth trading strategy; i.e., the constructed index must be a stationary process. We present an empirical study in Section

The stock closing price is

stock price data is

and the time parameters are

sum=0;

sum=sum+

R_mean=

sum=0

sum=sum+

sum1=0

sum1=sum1+

sum2=0;

sum2=sum2+

The analysis process of the cross and deviation strategy of DIF-HVIX and DEA-HVIX includes the following three steps.

Calculate the values of DIF-HVIX and DEA-HVIX.

When DIF-HVIX and DEA-HVIX are positive, the MACD-HVIX line cuts the signal line of HVIX in the uptrend, and the divergence is positive, there is a buy signal confirmation.

When DIF-HVIX and DEA-HVIX are negative, the signal line of HVIX cuts the MACD-HVIX line in the downtrend, and the divergence is negative, there is a sell signal confirmation.

We first perform an empirical study on the buy-and-sell strategy, which involves buying today and selling tomorrow. We use the historical data for the stock “-zgrs-” from November 2, 2015, to September 21, 2017, from the Shanghai stock market. First, we develop the strategy for the new index and calculate the prediction accuracy and cumulative return of the stock with two different indicators. Then, we compare the accuracy rate and cumulative return. The accuracy here is calculated according to whether the stock price rises on the second day. Furthermore, we test a buy-and-hold strategy for the proposed model. The buy-and-hold strategy is a trading strategy in which the traders hold the stock for a while instead of selling it on the next trading day. We use the historical data for the stock “-dggf-” from July 27, 2009, to November 3, 2017, from the Shanghai stock market to test a 5 d buy-and-hold strategy and use the historical data for the stock “-payh-” from June 22, 1993, to May 10, 2010, from the Shanghai stock market to test a 10 d buy-and-hold strategy. The detailed trading strategy is similar to the buy-and-sell strategy. Here, we use

From the “-zgrs-” stock data chosen in Section

Historical volatility of “-zgrs-” with the buy-and-sell strategy.

Next, using the calculated volatility index, we calculate the weight of the EMA formula in Section

Figure

Candlestick chart and MACD histogram for “-zgrs-” with the buy-and-sell strategy. (For interpretation of the references to color in the figure, the reader is referred to the web version of the article.)

In the MACD histogram, the solid line represents the DIF, the dotted line represents the DEA, and the histogram represents the MACD bar. According to the strategy described in Section

Buy-and-sell signals in the candlestick chart and MACD histogram for the buy-and-sell strategy.

Figure

Candlestick chart and MACD-HVIX histogram for “-zgrs-” with the buy-and-sell strategy. (For interpretation of the references to color in this figure, the reader is referred to the web version of the article.)

Buy-and-sell signals in the candlestick chart and the MACD-HVIX histogram for the buy-and-sell strategy.

To verify the stability of the new indicator, we compare the MACD and MACD-HVIX in Figure

Comparison of the two indicators for the buy-and-sell strategy.

Table

Comparison of the specific values of the buying-selling points for the buy-and-sell strategy.

Test date | Price_(Test date) | Price_(Test date_+_1 d) | Predicted trend | Actual trend | |
---|---|---|---|---|---|

MACD | 155 | 20.39 | 20.42 | | |

212 | 21.82 | 21.93 | | | |

290 | 25.32 | 25.38 | | | |

310 | 26.44 | 26.50 | | | |

355 | 24.51 | 24.62 | | | |

381 | 27.93 | 27.45 | | | |

393 | 29.00 | 28.48 | | | |

| |||||

Win rate | 0.4286 | ||||

| |||||

MACD-HVIX | 118 | 22.24 | 21.90 | | |

187 | 20.80 | 20.66 | | | |

222 | 21.90 | 21.84 | | | |

231 | 21.80 | 21.67 | | | |

241 | 21.65 | 21.58 | | | |

243 | 21.78 | 21.83 | | | |

292 | 25.18 | 25.58 | | | |

415 | 27.98 | 28.80 | | | |

447 | 29.27 | 29.51 | | | |

| |||||

Win rate | 0.6667 |

Using the “-dggf-” stock data chosen in Section

Comparison of the specific values of the buying-selling points with the buy-and-hold strategy applied for 5 d.

Test date | Price_(Test date) | Price_(Test date_+_5 d) | Predicted trend | Actual trend | |
---|---|---|---|---|---|

MACD | 391 | 13.04 | 15.70 | | |

791 | 4.81 | 5.19 | | | |

881 | 5.55 | 5.61 | | | |

911 | 5.71 | 5.59 | | | |

1071 | 6.57 | 6.74 | | | |

1181 | 6.66 | 6.95 | | | |

1326 | 10.70 | 11.93 | | | |

1481 | 17.28 | 13.51 | | | |

| |||||

Win rate | 0.6250 | ||||

| |||||

MACD-HVIX | 371 | 11.68 | 12.00 | | |

751 | 5.53 | 5.75 | | | |

771 | 5.76 | 5.62 | | | |

1201 | 7.66 | 7.83 | | | |

1331 | 11.93 | 12.23 | | | |

1561 | 16.89 | 19.05 | | | |

| |||||

Win rate | 0.8333 |

Candlestick chart and MACD histogram for “-dggf-” with the buy-and-hold strategy applied for 5 d. (For interpretation of the references to color in this figure, the reader is referred to the web version of the article.)

The MACD-HVIX histogram in Figure

Candlestick chart and MACD-HVIX histogram for “-dggf-” with the buy-and-hold strategy for 5 d. (For interpretation of the references to color in this figure, the reader is referred to the web version of the article.)

Comparison of the two indicators with the buy-and-hold strategy applied for 5 d.

Table

Next, using the “-payh-” stock data chosen in Section

Comparison of the specific values of the buying-selling points with the buy-and-hold strategy applied for 10 d.

Test date | Price_(Test date) | Price_(Test date_+_10 d) | Predicted trend | Actual trend | |
---|---|---|---|---|---|

MACD | 621 | 6.59 | 6.23 | | |

901 | 18.87 | 19.05 | | | |

1971 | 13.05 | 13.22 | | | |

2071 | 12.25 | 10.31 | | | |

2291 | 11.11 | 10.52 | | | |

2431 | 10.56 | 10.81 | | | |

2661 | 8.51 | 8.23 | | | |

| |||||

Win rate | 0.7143 | ||||

| |||||

MACD-HVIX | 901 | 18.87 | 19.05 | | |

2071 | 12.25 | 10.31 | | | |

2421 | 11.30 | 10.56 | | | |

2661 | 8.51 | 8.23 | | | |

2741 | 6.95 | 7.19 | | | |

| |||||

Win rate | 0.8000 |

Candlestick chart and MACD histogram for “-payh-” with the buy-and-hold strategy applied for 10 d. (For interpretation of the references to color in this figure, the reader is referred to the web version of the article.)

The MACD-HVIX histogram in Figure

Candlestick chart and MACD-HVIX histogram for “-payh-” with the buy-and-hold strategy applied for 10 d. (For interpretation of the references to color in this figure, the reader is referred to the web version of the article.)

Comparison of the two indicators with the buy-and-hold strategy applied for 10 d.

Table

The computational complexity of the MACD and MACD-HVIX for a stock which has a length of n are

As indicated by Tables

The data used to support the findings of this study are available from the corresponding author upon request.

The authors declare that there are no conflicts of interest regarding the publication of this paper.

The first author (Jian Wang) was supported by the China Scholarship Council (201808260026). The corresponding author (J.S. Kim) expresses thanks for the support from the BK21 PLUS program.