Next Article in Journal
Socio-Technical and Political Complexities: Findings from Two Case Studies of Large IT Project-Based Organizations
Previous Article in Journal
Research on the Effectiveness of Deep Learning−Based Agency Cost Suppression Strategy: A Case Study of State−Owned Enterprises in Mainland China
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Time Series Model Based on Deep Learning and Integrated Indicator Selection Method for Forecasting Stock Prices and Evaluating Trading Profits

1
Department of Information Management, National Yunlin University of Science & Technology, Douliou, Yunlin 640301, Taiwan
2
Department of Business Administration, I-Shou University, Kaohsiung 840301, Taiwan
*
Author to whom correspondence should be addressed.
Systems 2022, 10(6), 243; https://doi.org/10.3390/systems10060243
Submission received: 19 October 2022 / Revised: 22 November 2022 / Accepted: 30 November 2022 / Published: 3 December 2022

Abstract

:
A stock forecasting and trading system is a complex information system because a stock trading system needs to be analyzed and modeled using data science, machine learning, and artificial intelligence. Previous time series models have been widely used to forecast stock prices, but due to several shortcomings, these models cannot apply all available information to make a forecast. The relationship between stock prices and related factors is nonlinear and involves nonstationary fluctuations, and accurately forecasting stock prices is not an easy task. Therefore, this study used support vector machines (linear and radial basis functions), gene expression programming, multilayer perceptron regression, and generalized regression neural networks to calculate the importance of indicators. We then integrated the five indicator selection methods to find the key indicators. Next, we used long short-term memory (LSTM) and gated recurrent units (GRU) to build time series models for forecasting stock prices and compare them with the listing models. To evaluate the effectiveness of the proposed model, we collected six different stock market data from 2011 to 2019 to evaluate their forecast performance based on RMSE and MAPE metrics. It is worth mentioning that this study proposes two trading policies to evaluate trading profits and compare them with the listing methods, and their profits are pretty good to investors. After the experiments, the proposed time series model (GRU/LSTM combined with the selected key indicators) exhibits better forecast ability in fluctuating and non-fluctuating environments than the listing models, thus presenting an effective reference for stakeholders.

1. Introduction

High-dimensional data lead to an increase in the complexity of interrelated components in stock trading systems, which in turn lead to the creation of complex information systems. Complex stock trading systems require understanding and modeling, and the role of data science, machine learning, and artificial intelligence in modeling stock trading. Therefore, stock forecasting and trading systems are complex information systems. Stock price forecasting is a very important issue in the financial field because accurate forecasting will bring great potential benefits to investors. Financial experts are interested in forecasting behavior models of stock prices, and investors are also interested in these patterns. In an economically frustrated and complicated investment environment, there is an urgent need to develop a tool that can reflect the future price index. For example, developing price forecasts for different stock markets and providing advice to decision makers can make investors profitable. However, time series forecasting in financial markets is considered one of the most challenging tasks in modern time series forecasting [1]. Many economists adopt the efficient market hypothesis (EMH), which believes that price changes are independent of the past and follow random walks [2]. Although there are many arguments for EMH, Abu-Mostafa and Atiya [3] argued that financial markets are somewhat predictable. Although the stock fluctuations are nonlinear and non-stationary, they will cause unexpected results. Currently, the powerful computing and problem-solving capabilities of artificial intelligence can take into account relevant available information, including past trading volume and prices, to forecast stock prices. Therefore, many researchers have established and are working on effective and accurate forecast models based on artificial intelligence. There are two methods commonly used to forecast stock prices: fundamental analysis and technical indicators. The former involves macroeconomic indicators and uses them as a general assessment; however, it is difficult to apply them to a complex stock market environment. The latter obtains new signals by inputting prices and selecting technical indicators to achieve the purpose of forecasting. This study will discuss and use technical indicators to explore forecasts of stock prices.
Today, there are many tools for forecasting stock prices, but forecasting stock prices is still extremely challenging. Since it involves obtaining stock market-related data, the original data often face high-dimensional problems; hence, forecasting stock prices without data preprocessing may lead to higher computational costs or overtraining. To solve this problem, most studies have used important variables based on the variable selection method as input variables to build forecast models for reducing the dimensionality of the original data [4,5,6,7,8,9,10]. The dimensionality reduction method reduces the dimensionality of the data to decrease the resources required for calculation and improve the performance of the model while retaining most of the information from the original data. Nobre and Neves [11] applied principal component analysis to reduce high-dimensional data and used the discrete wavelet transform to model the data after dimensionality reduction, and their profit was better than that of the buy and hold strategy. Chen et al. [12] used the Granger causality test to determine whether a time series has a positive impact on the forecast of another time series because this test method provides meaning to the causality of the time series. Based on the statistical test, their forecast of the stock index in the multilayer perceptron regression had a good performance.
There are many time series forecast models for stock market forecasting. Models for forecasting stock prices can be divided into two categories: statistical and machine learning models. Statistical models usually assume that stock price movements are generated linearly and follow a normal distribution, but the actual stock price movement is often not an assumption of normal distribution and linear relation. Time series statistical models include an autoregressive integrated moving average (ARIMA), generalized autoregressive conditional heteroskedasticity [13], etc. One shortcoming of the traditional statistical time series model is that the data sequence needs to be stationary, but this phenomenon is inconsistent with the non-stationarity and non-linearity of stock price fluctuations. In recent years, deep learning (DL) has been a hot topic in data science, and its technologies have been successfully applied in the financial field. DL has the advantages of not requiring prior feature extraction and automatically extracting features based on deeper and more complex networks. Hence, it has more powerful computing capabilities to build models. DL technologies include fuzzy neural networks, artificial neural networks, long short-term memory (LSTM), and gated recurrent unit (GRU), and their algorithms can construct many complex forecast models based on experience with no restrictive or statistical assumptions. Therefore, this study compared DL technology with listing methods for forecasting six different stock indexes.
How can decision makers trust the recommendations of deep learning and justify them [14]? From previous studies, we find that the research on the stock market is quite diversified, including forecasting the volatility of stock prices, stock price trends, and stock price returns, and trying to obtain more effective forecasts. Experts have struggled to develop effective forecasting methods based on empirical evidence; regardless of the statistical model, DL and the combined time series with DL provide considerable empirical literature support. Previous studies have some limitations: (1) traditional time series models are based on data stationarity and statistical assumptions; (2) a simple time series model cannot consider multiple variables and be limited by linear relationships; (3) selecting important technical indicators using statistical test methods, which are limited by relevant assumptions and which could not guarantee the degree of correlation to stock prices; and (4) previous studies applied moving windows to forecast future data, and their results showed that the time series model would be unstable and have large errors for data forecast.
To improve the problems mentioned above, this study proposes a time series deep learning model based on integrated multiple variable selection methods for forecasting short-period stock prices. The contributions of this study are as follows:
(1)
Screen technical indicators as research variables from the literature review, and then transfer the four basic information (opening, highest, lowest, and closing price) of stock trading into the technical indicators;
(2)
Find the key variables using an integrated indicator selection method (IISM) to synthesize the chosen variable of support vector machines (linear and radial basis function), gene expression programming, multilayer perceptron regression, and generalized regression neural network;
(3)
Apply LSTM and GRU to build time series models for forecasting stock prices and compare with the listing methods, and we use one-step ahead forecasting to accurately reflect the trading situations of investors in the stock market;
(4)
Propose two trading policies to compare their profits with the listing methods, and the results can provide investors with a reference to the direction of future investment strategies.
The remaining sections of the current study are arranged as follows. Section 2 describes the relevant literature, including technical indicators, variable selection, and time series deep learning algorithms. Section 3 presents the proposed computational steps and trading policy. The experimental results and discussions are presented in Section 4. The final section presents the conclusions and future work.

2. Related Work

This section introduces the relevant literature used in the current study, including technical indicators, variable selection, and time series deep learning algorithms.

2.1. Technical Indicators

In the stock market, the ultimate goal is to obtain the best investment portfolio to achieve profitability and avoid risks. A good investment portfolio must have market-related knowledge, and technical analysis is a good portfolio tool. The earliest technical analysis can be traced back to Cowles [15], who used past prices, transaction volumes, and other available data to predict future price trends. Neely et al. [16] proposed a well-known technical analysis, and they used technical indicators to predict stock risk premiums. Peng et al. [17] summarized 51 technical indicators used in recent financial forecast studies. Wang et al. [18] used five trading rules to generate a total of 105 technical indicators, and their results showed that technical indicators perform better than economic indicators for portfolio allocation. Tsai et al. [19] stated that technical analysis should consider indicators that are representative of past financial market data. Furthermore, Leung and Chong [20] found that the Bollinger band (BB) is better than the moving average because it considers price volatility. These existing studies analyzed the profitability of trading strategies based on various technical indicators [16], and technical indicators are usually composed of two parts: lagging indicators and leading indicators. The lagging indicators are usually used to measure trends, and the leading indicators are usually used to buy or sell signals.
Many technical indicators have been applied in the financial market. Tay and Cao [1] collected five real futures contracts from the Chicago mercantile market as their datasets. The input variables were four lagged relative differences in percentage (RDP(5), RDP(10), RDP(15), and RDP(20)) and a 15-day lagged exponential moving average (EMA(15)) of the closing price. The results showed that the support vector machine outperformed the back proposition neural network. Chang et al. [21] used a piecewise linear and neural network to analyze the nonlinear relationship between closing prices and technical indicators and to reveal the trading signals of historical data. Their technical indicators included four different moving average lags (MA(5), MA(6), MA(10), MA(20)), two different bias lags (BIAS5, BISA10), two different RSIs lag (RSI(6), RSI(12)), a nine-day stochastic line (K%D), Williams %R line, and trading volume. Ahmar [22] developed Sutte technical indicators and compared them with simple moving average and moving average convergence/divergence, and the results showed that Sutte indicators could be used as indicators to forecast stock prices. Lai et al. [23] empirically analyzed the influence of psychological biases on technical signals. The results showed that disposition, information cascade, and anchoring effects significantly impact trading signals.
In the existing literature, either many technical indicators are used, or the technical indicators are derived according to the researcher’s preference to predict the price. Therefore, we collect the technical indicators that have appeared in recent high-quality journals and financial market trading, and we summarize those technical indicators repeatedly appearing in our collected literature as the technical indicators of this study. There is a total of 23 technical indicators, as shown in Table 1 and Table A2 in Appendix.

2.2. Indicator Selection

Technical analysis can provide signals for investors to enter and exit the market; hence, it is very important for investors to select the correct technical indicators as the input variables of the model in order to effectively obtain investment signals and avoid investment risks. If too many technical indicators are used to solve the high-dimensional problem, it creates computational complexity and a high cost for a model algorithm [24]. Therefore, selecting important indicators (variable reduction) can help researchers understand data, reduce computational requirements, decrease the impact of high dimensionality, and improve forecast performance [25].
The indicator selection method can be viewed as a search technique for finding new subsets of indicators, combined with evaluation metrics for different subsets of indicators. The simplest method is to test every possible subset of indicators and find the subset of indicators that minimizes the prediction error rate. The indicator selection method can be divided into the wrapper, filter, and embedded methods [26] as follows.
(1)
The wrapper method uses the predictive model to evaluate a subset of indicators, and each new subset is used to train a model. Because wrapper methods train a new model for each subset, they are very computationally expensive but usually provide the best performing set of indicators for that particular type of model or typical problem. In traditional regression analysis, the most popular form of indicator selection is stepwise regression, which is a wrapper technique.
(2)
The filter method uses a proxy instead of error rates to evaluate a subset of indicators. This method was chosen for fast computation while still capturing the usefulness of the indicator set. Commonly used methods include mutual information, Pearson correlation coefficient, etc. Filters are generally less computationally intensive than wrappers, and many filter methods provide an indicator ranking. One other popular approach is the recursive feature elimination algorithm [27] commonly used with support vector machines to repeatedly build a model and remove indicators with low weights.
(3)
Embedded methods are an all-encompassing set of techniques that perform indicator selection during model building. These methods tend to fall between filters and wrappers in terms of computational complexity.
Based on the collected literature on technical indicators, we found out that 23 technical indicators repeatedly appear in our collected literature, and the 23 technical indicators are used in this study, as shown in Table 1. To find the key technical indicators, we applied multilayer perceptron regression (MLPR), support vector regression (SVR), generalized regression neural network (GRNN), and gene expression programming (GEP) algorithms to select the technical indicators of each stock market, as these four intelligent algorithms belong to the filter method with less computational complexity and provide an indicator ranking function. The following introduces the four intelligent indicator selection algorithms used in this study.
(1)
Multilayer perceptron regression
Multilayer perceptron (MLP) is a kind of feedforward neural network that contains at least three layers (input, hidden, and output layer) and uses back proposition to achieve supervised learning [28]. The number of neurons and neural network layers are hyperparameters of the network. Generally, each neuron in the hidden layer has input, weight, and error. Each neuron also has a nonlinear activation function that produces the cumulative output of previous neurons [29]. MLP neurons can freely perform classification or regression based on their activation functions, and MLP uses a high-performance method in random schemes, fitness approximation, and regression analysis [30].
(2)
Support vector regression
The support vector machine (SVM) was first developed by [31], and has been successfully applied in classification and regression tasks, especially in time series forecasting and financial applications [32]. SVM uses kernel functions to transfer from low-dimensional to high-dimensional space, and it has many kernel functions, such as linear and radial basis function (RBF). SVM is well-known in classification problems, and SVM used in regression is called support vector regression (SVR). Previous studies applied SVR to forecast time series patterns and compared linear and RBF kernel functions [33,34]. The results showed that SVR with RBF kernel function is superior to other kernel functions in non-trend forecasting, and SVR with linear kernel function is better than RBF kernel function in trend forecasting.
(3)
Generalized regression neural network
GRNN provides an estimated value of continuous attributes and converges to the linear or nonlinear regression surface; it has a single-layer learning algorithm with a high-dimensional parallel structure [35]. GRNN uses a radial function as its core and has good nonlinear computing performance. There are no model parameters to be trained and the convergence speed is fast. The internal structure of this algorithm includes the input, model, summing, and output layers.
(4)
Gene expression programming
The GEP algorithm [36] starts with the random generation of chromosomes of an initial population, and it expresses the chromosomes and evaluates the adaptability of each individual. According to their adaptability to select individuals, the process simulates reproduction, crossover, and mutation; hence, the offspring have new traits and a new generation of individuals. A certain number of generations or stopping rules are set to repeat the above process until a solution is found [36]. GEP is an evolutionary algorithm closely related to genetic algorithms and genetic programming, and it inherits a fixed-length linear chromosome from a genetic algorithm. The advantage of GEP is that all decisions related to the growth of the tree are calculated using the algorithm itself without any manual entry.

2.3. Time Series Deep Learning Algorithm

A time series is a kind of continuous data formed in order of time, and its data contain three characteristics: stationarity, seasonality, and trend. A time series data point is a fixed period (for example, one day, hour, minute, etc.), and the difference between time series and regular data is that there is a correlation between time points. Therefore, two adjacent data cannot be considered independent, and the next data can be forecasted using the previous data. Time series forecasting is a challenging task because the basic data generation process is dynamic, nonlinear, and uncertain [37]. Traditional time series models [38] have many forms, representing different random processes; the three most common types are autoregressive (AR), integral (I), and moving average (MA) models, or ARIMA. The ARIMA model and its derivative models have become very popular, mainly due to their flexibility and simplicity in the modeling process [39]. Time series forecasting has many applications, including in finance, meteorology, business, computer science, and interdisciplinary fields.
Recently, powerful computer calculations have made machine learning and deep learning a hot topic. Machine learning learns a model from data (data-driven model). Deep learning is essentially a subset of machine learning that extends the capabilities of machine learning to multilayer neural networks. The financial market usually uses time series data; hence, we used two deep learning algorithms to handle time series as forecast models. This section introduces the two time series deep learning models (LSTM and GRU) used in this study.

2.3.1. Long Short-Term Memory

The recurrent neural network (RNN) was originally a neural network for learning time series data, but the disappearance of the gradients of RNN as the network layer deepens has not been solved. LSTM was proposed by Hochreiter and Schmidhuber [40] to solve the RNN problem. LSTM network is very suitable for processing classification and forecasts based on time series data. LSTM consists of four units [41]: (1) input gate: when data is input, the input gate can control whether to input the value and calculate the value; (2) memory cell: memorizes the calculated value to facilitate the use of the next cell; (3) output gate: controls whether to output the calculated value; if there is no output at this time, the value will be 0; (4) forget gate: controls whether to clear the memory. The sigmoid function is the main rule of LSTM in the equations. According to different inputs and outputs, LSTM has different basic types: (1) many to one: multiple time points to forecast the next time point (such as input: stock price for one week, output: stock price for next Monday); and (2) many to many: multiple related data to forecast the next temporal or next to related data.

2.3.2. Gated Recurrent Unit

GRU is a kind of RNN proposed by Cho et al. [42] and it can speed up execution and reduce memory consumption to improve the shortcomings of LSTM [43]. GRU can achieve the same performance as LSTM, and it is easier to train and greatly improve training efficiency; hence, we are more inclined to use GRU in many cases. GRU is smart because it uses an updated memory gate to simultaneously forget and select memories, while LSTM uses multiple gates (input and forget gates). The advantage of GRU is that the structure of GRU (input and output) is similar to RNN, and the internal idea is similar to LSTM. Compared with LSTM, GRU has fewer parameters, a simpler structure, faster convergence speed, and a better prediction effect [44].

3. Proposed Method

A stock price trend is considered nonlinear, uncertain, and unstable, and even financial experts cannot accurately forecast prices. Investors believe that stock investment must have a good profit to boost investors’ confidence. However, complete historical data and related literature still cannot accurately forecast stock prices. Technical analysis is a good portfolio tool that uses past prices, transaction volumes, and other available data to predict future price trends. Technical indicators from past stock data are related to the forecast stock price trend, and the rise and fall of the trend signal investors entering and exiting the stock market. Technical indicators are usually composed of lagging and leading indicators: the lagging indicators are usually used to measure trends, and the leading indicators are usually applied to buy or sell signals. Furthermore, technical indicators perform better than economic indicators for portfolio allocation [18]. Therefore, this study converts historical data (opening, highest, lowest, and closing prices) of the stock market into technical indicators as research variables.
Stock analysts and investors can use many technical indicators and market indicators as the basis for investment strategies, but not all technical indicators are suitable as input variables for forecast models. In the past, technical analysts used subjective judgments to determine which technical indicators were suitable for the timely reflection of data at a given time and whether the model was effective, but subjective judgments do not provide any factual evidence. Tan [45] stated that the selection of stock data and technical indicators to be used would depend on the following factors: correlation between technical indicators and the stock price, availability (the data must be easily obtainable), the sufficiency of the historical databases (there must be enough sample data), periodicity of the data, and reliability of the data. Therefore, we collected six stock markets as datasets: Taiwan weighted index (TAIEX), Nikkei average index (Nikkei 225), Hang Seng index (HSI), Standard & Poor’s index (S&P 500), SSE (China A Shares), and Dow Jones industrial average (DJI). To objectively select important technical indicators, this study applies SVM, GEP, MLPR, and GRNN to screen the important indicators, and then we use the proposed IISM to synthesize the chosen indicators of SVM, GEP, MLPR, and GRNN. The reason for choosing these four models is listed as follows: (1) MLPR can perform regression based on their activation functions and it uses a high-performance method in random schemes, fitness approximation, and regression analysis [30]. (2) SVR is well-known in regression forecast. Previous studies applied SVR to forecast time series patterns [33,34] and their results were better performance in nonlinear forecasting. (3) GRNN uses a radial function as its core and has good nonlinear computing performance [35]; there are no model parameters to be trained and the convergence speed is fast. (4) GEP is an evolutionary algorithm and can be used in forecast problems; the advantage of GEP is that all decisions related to the growth of the tree are calculated using the algorithm itself without any manual entry [36].
Although there are many time series models to forecast stock prices, there is still room for improvement. Current models have (1) assumptions for data stationarity and statistical distribution, (2) no consideration for multiple variables and handling nonlinear relationships, and (3) no strategy for comprehensively selecting important indicators. To address these problems, this study proposes a time series deep learning model based on the IISM method for forecasting stock prices and presents a trading policy to evaluate the profits of different stock markets. In comprehensively selecting important technical indicators, the current study considers that different combinations of lagging and leading indicators will impact the forecast results. We selected the most commonly used technical indicators in the past literature as research variables. Furthermore, we used support vector machines (linear and radial basis functions), gene expression programming, multilayer perceptron regression, and generalized regression neural networks to select important variables and find the key variables by IISM. In building a forecast model, we applied deep learning LSTM and GRU to build a time series model for forecasting stock prices and compare them with three intelligent time series forecast models. In other words, the proposed model is LSTM/GRU combined with the selected key indicators. Therefore, we list the research hypothesis to describe what this research expects to experiment and demonstrate as follows.
Hypothesis 1:
The proposed model based on the selected key indicators is a good forecast model for stock markets.
Hypothesis 2:
The proposed model with the selected key indicators has the best total profits.
Hypothesis 3:
The proposed trading policy has better total profits in the stock markets.

3.1. Proposed Computational Steps

To easily understand the proposed method, this section explains the five computational steps and a visualization procedure used in this study, as shown in Figure 1. The detailed calculation steps are described below.
  • Step 1: Data collection and preprocessing
This study uses the pandas-DataReader of Python programming language [46] to collect six stock markets’ data from Yahoo Finance [47]. The six stock markets are the Taiwan weighted index (TAIEX), Nikkei average index (Nikkei 225), Hang Seng index (HSI), Standard & Poor’s index (S&P 500), SSE (China A Shares), and Dow Jones industrial average (DJI), and their descriptions are shown in Table A1. In the data preprocessing, the collected time series data of six stock markets are from 2011 to 2019, and we used each year’s data as the dataset unit (six stock markets × nine-year datasets = 54 datasets). The dataset of each year was partitioned into the training data (from January to October) and the testing data (from November to December).
Next, the four basic data (opening, highest, lowest, and closing price) of the stock market were converted into technical indicators; however, different technical indicators had different lag periods, such as EMA(26) with 26 lag periods. To avoid missing data, the current study used the latest data from the previous year to make up the number of lag periods for calculating the technical indicators, and subsequently, we obtained the full technical indicators of each year’s data. The collected 23 technical indicators are most commonly used in the past literature as research variables and include the moving average (MA), the relative difference in percentage (RDP), BIAS, relative strength index (RSI), exponential moving average (EMA), moving average convergence and divergence (MACD), psychological line (PSY), William indicator (WMS%R), stochastic K%D, price rate of change (PROC), momentum (MO), lag period (LAG), and basic trading volume (Volume). The definitions of the detailed technical indicators are provided in Table A2.
  • Step 2: Indicator selection
To reduce the computational complexity and the high cost of the forecast model, this step introduces how to objectively select important technical indicators to solve high-dimensional problems. This study applies SVM (the kernel function is linear and RBF), GEP, MLPR, and GRNN to select important technical indicators for each year’s dataset of the six stock markets (a total of 54 datasets). These algorithms ranked the impact of 23 technical indicators on the closing price. The most important indicator took 100 as the highest score, and the other indicators were between 0 and 99 points, depending on their importance. We set a score of less than 1 as the threshold for discarding indicators because their impact is relatively small. Then, we summarized the selected indicators of five algorithms for each year’s dataset of the six stock markets (54 datasets). In Table 1, we present only the important indicators selected by the five algorithms in the 2019 DJI stock market as an example.
To find the key variables, the current study proposed a simple integrated indicator selection method (IISM) to synthesize the chosen indicators of SVM, GEP, MLPR, and GRNN. The IISM’s purpose is to join the selected indicators of the five algorithms, which is the concept of the union in set theory, to integrate the indicators selected by the five algorithms. Similarly, we used the DJI stock market in 2019 as an example to illustrate that IISM integrated the results of the indicators selected by the five algorithms, as shown in the last column of Table 1.
  • Step 3: Model building
Most stock markets usually use time series data; hence, the current step chooses two deep learning algorithms that can handle time series as a forecast model. After selecting key indicators using the IISM method of Step 2, the current step uses the selected key indicators to build a time series deep learning forecast model using LSTM and GRU algorithms (the proposed model). Furthermore, we also used LSTM and GRU algorithms based on the full indicators (23 indicators) to build a time series deep learning forecast model for comparison with the proposed model. Based on the minimum root mean square error (RMSE), in this step, we used the training data to adjust and optimize the parameters of the forecast model, and the time series forecast model was established when the optimized parameters were obtained.
  • Step 4: Forecast
In each dataset of different markets for forecast, the first 10-month period is used for initial training, and those from November to December are selected for testing. Time series forecasting describes forecasting observations at the next time step; hence, it is called one-step ahead forecasting because only a one-time step is forecasted. After the time series forecast model is established (initial training), the current step uses one-step ahead forecasting to forecast the testing data of six stock markets (a total of 54 testing data are implemented) because one-step ahead forecasts can accurately reflect the trading situations of investors in the stock market. In the forecasting process, we forecast only one observation of the testing data each time. That is: (1) when forecasting the first observation, we directly use the established model to forecast the closing price; (2) when forecasting the second observation, the first observation of the testing data will be added to the training data, and we check whether the established model has been corrected before forecasting the second one; (3) when forecasting the third observation, the first and second observations of the testing data will be added to the training data, and we check whether the established model has been corrected before making a forecast; and (4) we repeat this forecasting steps until the last observation of the testing data.
  • Step 5: Forecast evaluation
This study uses the two most common metrics in the literature, RMSE [17] and the mean absolute percentage error (MAPE) [39], to measure forecasting performance and compare the proposed model with the listed models. Furthermore, we use standard deviation (SD) to evaluate forecast stability. The equations of RMSE and MAPE metrics are defined as follows:
R M S E = i = 1 n y i y i ^ 2 n
M A P E = 100 n i = 1 n y i y i ^ y i
where yi denotes the actual closing price at time i, y i ^ . represents the closing price forecasted at time i, and n means the number of the testing data.
To strengthen the verification of the proposed model comparison, we compared the proposed model with the other three models (SVR, GRNN, and MLPR) based on the two metrics.

3.2. Proposed Trading Policy

Profit maximization can be based on estimates of potential profits and risks. However, designing a profit policy in a complex and volatile stock market is challeng-ing. Every investor wants a winning policy. There is no doubt that in such a complex and volatile stock market, it is not easy to design a profitable strategy. In powerful computation, it is important to use deep learning algorithms to forecast stock prices accurately. However, an accurate stock price forecast is not enough because profitabil-ity is more important for investors. To maximize profits, a good trading policy can bring investment profit, and the greatest profit is the most important thing for decision makers. Therefore, this study proposes two trading policies to compute a profitable unit; further, we also consider the stamp duty of different stock markets in this work. The stamp duty of different countries can refer to [48] (HK, China, and Taiwan are 0.1%; Japan is no financial transaction tax; US is 1.5%). Trading policy 1 is as follows: (1) when the forecast rises >0, buy at the opening price of the next day; and (2) when the forecast falls <0, sell at the opening price of the next day. The first trading policy can be expressed as Equations (3) and (4), and the proposed algorithm for trading pol-icy 1 is shown in Algorithm 1.
Buy signal:
If forecast (t + 1)−actual(t) > 0, then buy the opening price of the next day
If forecast (t + 1)−actual(t) < 0, then sell the opening price of the next day
Trading policy 2 is: (1) buy the opening price of the next day when the forecast rises 1%; (2) sell the opening price of the next day when the forecast falls 1%. The second trading rule can be expressed as Equations (5) and (6).
Buy signal:
If   f o r e c a s t t   + 1 a c t u a l t a c t u a l t > 0.01 ,   then   buy   the   opening   price   of   the   next   day
Sel signal:
If   f o r e c a s t t   + 1 a c t u a l t a c t u a l t < 0.01 ,   then   sell   the   opening   price   of   the   next   day
Algorithm 1: Proposed Trading “Policy 1”
Input: forecast_close, actual_close, actual_open, forecast_length
Output: profit
  • stock = 0
  • Sig = []
  • for i in range(forecast_length) do
  •   if forecast_close[i + 1] − actual_close[i]) > 0 and stock == 0:
  •     stock += 1
  •     sig add 1
  •   elif (forecast_close[i + 1] − actual_close[i]) < 0 and stock == 1:
  •     stock −= 1
  •     sig add −1
  •   else:
  •     sig add 0
  • buy_price = 0
  • sell_price = 0
  • stock = 1
  • profit = 0
  • for i in range(forecast_length) do:
  •   If sig[i] == 1:
  •     buy_price = actual_open[i+1]
  •     stock +=1
  •   elif sig[i] == −1 and stock == 1:
  •     sell_price = actual_open[sig.index[i+1]]
  •     stock −= 1
  •     profit = profit + (sell_price-buy_price)
  •     buy_price = 0
  •     sell_price = 0−
  •   if stock == 1 and buy_price! = 0 and sell_price == 0:
  •     sell_price = actual_open[len(sig) − 1]
  •     stock −= 1
  •     profit = profit + (sell_price − buy_price)
  • return profit
  • end
The main differences between the proposed trading policy 1 and the trading policy of Chen et al. [49] are that the proposed trading policy 1: (1) changes its sell signal to a buy signal, and changes its buy signal to a sell signal and (2) changes its closing price to the opening price at the trading time point. To verify, we will compare the profitability of the two proposed trading policies with the trading policy of Chen et al. [49] in Section 4.3.

4. Experiments and Results

This section introduces the experimental environment, experiment and comparison, profit comparison, and discussion.

4.1. Experimental Environment

The experimental environment of this study was a computer with a GTX1650 display card, RAM 16G, and Python 3.7 installed on a Win10 system, and PyCharm was used for programming and compilation. The five forecast algorithms used in this experiment are LSTM, GRU, SVR, GRNN, and MLPR. The current experiment used Python to develop these five forecast models, and we imported LSTM, GRU, and MLPR models using the Keras suite, GRNN model with neupy, and SVR model with sklearn. Among them, adaptive moment estimation (Adam) was selected for optimizing the hyperparameters of LSTM, GRU, and MLPR, and linear and RBF kernel functions were selected for SVR. The parameter settings of the five forecast models are shown in Table 2.

4.2. Experiment and Comparison

This section describes the proposed computational steps for implementing the experiments, and we introduce these experimental results according to the key indicators, descriptive statistics, and forecast comparison as follows.
(A)
Key indicators
In selecting key indicators, the current study applies SVM (kernel function is linear and RBF), GEP, MLPR, and GRNN to select important technical indicators for each year dataset of the six stock markets, and then we use IISM in computational step 2 of Section 3.1 to find the key technical indicators from all 54 datasets (six stock markets × nine-year datasets = 45 datasets), as shown in Table 3. We found that the indicators that were not selected were RSI, PSY(12), %K, and Volume; the ones that were selected once were PSY(24), W%R, and PROC; and the ones that were selected twice were %D. Further, we observed that the indicator LAG had the highest frequency of 45 times, which is the most key indicator in all 45 datasets of this study. Secondly, EMA(26) was selected 44 times, and EMA(12) was selected 43 times. The remaining indicators are shown in Table 3. Lastly, we ranked the ordering of the 15 key indicators selected as follows: LAG > EMA(26) > EMA(12) > MA(5) > BIAS(24) > MO > MA(20) > BB up > BIAS(6) > BB down > DIF > BIAS(12) > DEM > OSC > RDP.
  • (B) Descriptive statistics
To understand the volatility of closing prices in different stock markets, we summarized the descriptive statistics to facilitate the understanding of the forecast ability of different forecasting models, as shown in Table 4. We observed that the standard deviation of the closing price in the DJI market from 2011 to 2015 was relatively less volatile, while it fluctuated sharply in 2017. The fluctuations in the closing prices of the S&P 500, SSE, and TAIEX were relatively stable compared to other stock markets. The closing prices in the HSI fluctuated drastically in 2011 and 2015–2019 because their standard deviations were large, and the closing prices of Nikkei 225 in 2013 and 2017 fluctuated significantly.
  • (C) Forecast comparison
After selecting the key indicators, the current study used all 23 indicators (full) of each dataset to forecast closing prices using the proposed model and compared them with the SVR, GRNN, and MLPR models. Based on RMSE and MAPE metrics, the forecast results of full indicators are shown in Table 5 and Table 6. We observed that the GRU model was stable with a smaller standard deviation and superior to the other four models in most of the datasets for the six stock markets. The LSTM model was the second-best model, and it performed better than the SVR, GRNN, and MLPR models.
As previously mentioned, the LSTM and GRU models had better performances. Hence, we compared the selected key indicators of each dataset with full indicators of the LSTM and GRU models, and the results are shown in Table 7 and Table 8. From the RMSE and MAPE metrics, the GRU combined with the selected key indicators was a better forecast model in the DJI, NIKKE225, and TAIEX stock markets. In the HSI and S&P 500 stock markets, the LSTM combined with the selected key indicators was better than the other forecast models in terms of RMSE, and it had a relatively low MAPE in the HSI stock market. In summary, the proposed model (GRU/LSTM combined with the selected key indicators) is a good forecast model for stock markets.
From Table 4 of the descriptive statistics, the DJI, HSI, and Nikkei 225 stock markets had large volatility in 2017. Therefore, we plotted the forecast and actual closing prices of the testing data for LSTM and GRU models combined with full and selected key indicators, which are shown in Figure 2, Figure 3 and Figure 4. The results showed that the proposed combined LSTM and GRU models with the selected key indicators were the best forecast model in a large fluctuation of stock markets.

4.3. Profit Comparison

This section describes the application of the two proposed trading policies to the calculation of profits. We also compared these policies with the trading rules proposed by Chen et al. [49]. The comparitive profits of proposed policy 1 and Chen et al.’s [49] trading policy are shown in Table 9, and the comparitive profits between proposed policy 2 and Chen et al.’s [49] trading policy are shown in Table 10.
Table 9 and Table 10 show that the total profits of the two proposed trading policies were better than Chen et al.’s [49] in the six stock markets. To compare the total profits of trading policies 1 and 2, we summarized Table 9 and Table 10 into Table 11. The proposed model (combined GRU with the selected key indicators) had the best total profits, except for HSI and SSE (China A Shares), as shown in trading policy 1 of Table 11. In trading policy 2, the proposed combined model won the total profits in the TAIEX stock market. Figure 5 shows the total profits of trading policies 1 and 2 for the six stock markets, and it shows that the best policy was the proposed trading policy 1 in DJI, S&P 500, HSI, SSE (China A Shares), and Nikkei 225; investing in TAIEX, the proposed trading policy 2 was the best policy. In summary, we suggest using the proposed trading policy 1 in DJI, S&P 500, HSI, SSE (China A Shares), and Nikkei 225, but we recommend investing in TAIEX using the proposed trading policy 2 because investments in TAIEX must wait for a strong trading signal (forecasted rise and fall >1%).

4.4. Discussion and Practical Applicability

In what follows, we discuss some major observations from the experiments and the results of the study.
(1)
Selecting key indicators
Selecting important indicators can effectively reduce computational requirements and improve forecast performance [25]. This study used SVM (the kernel function is linear and RBF), GEP, MLPR, and GRNN to select important indicators, and then we used the proposed IISM to find the key indicators for all 54 datasets. From Table 3, we found that the indicators PSY_12, PSY_24, RSI, %K, %D, W%R, PROC, and Volume were selected between 0 and 2 times and that these indicators had little influence on forecasting stock prices. Thus, we could carefully remove these indicators in future research. Lastly, we selected 15 key indicators and ranked them as LAG > EMA(26) > EMA(12) > MA(5) > BIAS(24) > MO > MA(20) > BB up > BIAS(6) > BB down > DIF > BIAS(12) > DEM > OSC > RDP. These 15 indicators can be merged into eight technical indicators: LAG, EMA, MA, BIAS, MO, BB, DIF, and MCAD. However, the 23 technical indicators are selected as important indicators in the nine datasets of SSE (China A Shares), and the PSY_12 and PSY_24 appear frequently.
Further, this study used the selected key indicators to test the lag period using the autoregressive distributed lag model, and the lag period and the key indicators were input into the proposed model. This did not yield better results because the technical indicators were effective in obtaining information about the gap period without excessively adding the lagged indicators. Thus, we suggest that traders and investors prioritize the above eight key indicators and add their own practical experiences in analyzing stock price trends. Further, the influence of investor psychological factors must be considered when investing in China’s A-shares.
(2)
Fluctuation and forecast ability
The volatility indicator was introduced 30 years ago, and many studies on forecasting the actual volatility of the stock market and the exchange rate have demonstrated its superior ability [51]. Fluctuation can be measured in a number of ways, including technical indicators (such as Cboe volatility index, BB, and average true range) and descriptive statistics (such as standard deviation and range). The current study used simple standard deviations and ranges that were both large to simultaneously determine whether the stock market has large volatility because technical indicators were used to measure the short-term volatility. From the descriptive statistics in Table 4 for 2017, the DJI, HSI, and Nikkei 225 stock markets had large volatility because 2017 was the year the market finally saw the end of a ten-year financial crisis [52], and the stock market hit a record high that encouraged investor psychology again, allowing a full frenzy. Further, HSI stock fluctuated drastically from 2015 to 2019 because China’s stock market bubble occurred in 2015–2016 [53], and many of China’s investors moved to the nearby Hong Kong stock market.
In forecasting, we observed that the proposed combined LSTM/GRU with the selected key indicators reduced the RMSE and MAPE, and it was the best forecast model for the large fluctuation market of 2017, as shown in Table 7 and Table 8 and Figure 2, Figure 3 and Figure 4. In a relatively stable market, the GRU combined with the selected key indicators was a better forecast model for the DJI, NIKKE225, and TAIEX stock markets, and the LSTM combined with the selected key indicators was better than the other forecast models in terms of RMSE in the HSI and S&P 500 stock markets. In summary, the results showed that the proposed model was not affected by fluctuation and non-fluctuation markets and showed good forecast ability.
(3)
LSTM and GRU advantages
Due to the rapid development of computer science, deep learning can handle many parameter problems and has higher speed, higher accuracy, and better robustness in complex situations. One of the main advantages of deep learning is that its feature layers are not designed by humans [54]. Conversely, features are learned from data using a universal learning procedure. The advantage of LSTM is that it can capture time information in time series data, and it can solve the disappearance of the gradients of RNN as the network layer deepens [40]. Furthermore, LSTM is very suitable for forecasting stock prices, and LSTM has an advantage compared to memory-free methods [9]. GRU is a kind of RNN proposed by Cho et al. [42] and it can accelerate execution and reduce memory consumption to improve the shortcomings of LSTM [43]. GRU does not lose to the performance of LSTM, and it is easier to train and greatly improves implementation efficiency. From Table 5, Table 6, Table 7 and Table 8, the GRU combined with the selected key indicators is a better forecast model than the listing models for the DJI, NIKKE225, and TAIEX stock markets; hence, we are more inclined to use GRU in forecasting stock prices.
(4)
Trading policy
In previous studies, all stocks were traded at the closing price during the period [55]. However, this work proposes trading policy 1, in which the stocks are traded at the opening price to compute the profitable unit, and changes the concept of “buy on lows and sell on highs” to “sell on lows and buy on highs.” To verify the proposed trading policy 1, we conducted a comparative experiment, and the results showed that the total profits of the proposed trading policy 1 were better than those of Chen et al. [49] in the six stock markets. Further, this study proposes trading policy 2 to verify whether we need to wait until the forecasted value rises and falls >1% and the profit is relatively high. The results showed that the proposed trading policy 2, only investing in TAIEX, had higher profits among the six stock markets. Based on the experimental results in Section 4.3, we recommend that: (1) the trading time should change the closing price to the opening price at the trading time point, (2) changing the concept of “buy on lows and sell on highs,” and (3) determining whether to wait until the forecasted value rises and falls >1%, based on the characteristics of different markets.
(5)
Research hypothesis
Based on Section 4.2 and 4.3 experimental results, this research has shown that the proposed three hypotheses are true as follows.
Hypothesis 1:
The proposed model based on the selected key indicators is a good forecast model for stock markets. Accepted, as shown in Table 7 and Table 8.
Hypothesis 2:
The proposed model with the selected key indicators has better total profits. Accepted, as shown in Table 11.
Hypothesis 3:
The proposed trading policy 1 has better total profits in the stock markets. Accepted, as shown in Table 11.
(6)
Practical applicability
  • From the market profits perspective and each year’s investment in six markets, we find the benchmarks as follows.
    (i)
    In terms of profits of six markets, we see that the Dow Jones stock market has the most profits, as shown in Table 11, and then we set the Dow Jones stock market as the benchmark.
    (ii)
    From profits of each year for six markets (as Table 9), we observe that 2019 (HSI, GRU_full), 2018 (DJI, GRU_selected), 2017 (HSI, LSTM_selected), 2016 (Nikkei, GRU_selected), 2015 (DJI, LSTM_selected), 2014 (HSI, LSTM_selected), 2013 (HIS, GRU_selected), 2012 (Nikkei, GRU_full), 2011 (DJI, GRU_selected) can be marked as benchmarks.
  • Based on the results of this study, we provide four suggestions for investors as references.
    (i)
    Consider the eight technical indicators (LAG, EMA, MA, BIAS, MO, BB, DIF, and MCAD) and add their own practical experience in analyzing stock price trends.
    (ii)
    Apply GRU combined with the selected key indicators to forecast stock prices because the proposed model can accelerate execution and reduce memory consumption.
    (iii)
    Use one step ahead to forecast stock prices because it can accurately reflect the trading situations of investors in the stock market.
    (iv)
    Employ the proposed trading policy 1 in the six stock markets and could consider the proposed trading policy 2 in the TAIEX stock market.
(7)
Opportunity costs
Opportunity cost is the potential benefit that an investor misses out on when choosing an alternative [56]. Understanding the opportunities that investors may miss when choosing one investment over another allows them to make better decisions. From the benchmarks of discussion, the Dow Jones stock market is a benchmark, and we calculate some simple opportunity costs based on DJI and 2018 as benchmarks, as shown in Table 12. The results show that investing in the S&P 500 instead of DJI will lose an opportunity cost of 17,669 units based on total profits of six markets; if we invest in S&P 500 but not in DJI, we will lose an opportunity cost of 3782.79 units from the total profits of six markets in 2018.

5. Conclusions

Investment has profits and risks; finding how to avoid risks and make profits is the ultimate goal of investors. Many investors have applied the relevant information systems to collect data and investment experience for ultimate gainful goals, which can bring profitable confidence. In the global investment market, stock investment is affected by many external environmental factors, and the stock market has many uncertain factors. It is difficult to correctly identify the influencing factors. Moreover, relevant factors and the stock price are nonlinear and nonstationary; hence, it is not easy to accurately forecast the stock price.
Although previous studies have proposed many forecast stock price models based on statistics and machine learning, their forecast abilities are still sub-optimal. Thus, investors need a forecasting model that has accurate time series forecast capabilities and considers the influence of different factors. Therefore, this study proposed a deep learning LSTM/GRU combined with the selected key indicators, which used a one-step ahead forecast to accurately reflect the trading situations of investors in the stock market. The experimental results show that the proposed model is not affected by fluctuation and non-fluctuation markets and shows good forecast ability. This study also proposed two trading policies to verify the validation of profits. The results show that the total profit of our proposed trading policy 1 is better than that of Chen et al. [49] in six stock markets. Based on the results of this study, we list the innovative aspects as follows.
(1)
This study collects technical indicators that have appeared in recent high-quality journals and financial market transactions, and then we summarize the technical indicators that frequently recur in the collected literature as the technical indicators of this study.
(2)
This paper proposes the IISM method to integrate the results of MLPR, SVR, GRNN, and GEP indicator selection and find 15 key technical indicators. These 15 indicators can be summarized as eight technical indicators: LAG, EMA, MA, BIAS, MO, BB, DIF, and MCAD.
(3)
This study proposes the combined LSTM and GRU models with the selected key indicators are better than the listing methods in a large fluctuation of stock markets, and we use one-step ahead forecasting to accurately reflect investors’ trading situations in the stock market.
(4)
Two trading strategies are proposed, and their profits are compared with the listing methods. The results can provide investors with a reference for future investment.
Although we use the one-step ahead forecast to accurately reflect the trading situation of investors in the stock market, the limitations of this study are that the stock price forecast is a short-term forecast, and our collected stock data is daily data instead of minute-by-minute data. Future studies may collect more indicators (fundamental, economic, and commodity) from the market and literature to build a time series forecast model and combine the intelligent method with a deep learning algorithm to develop a forecast system of stock prices.

Author Contributions

Conceptualization, C.-H.C. and M.-C.T.; methodology, C.-H.C. and M.-C.T.; software, C.C. and M.-C.T.; validation, C.C., C.-H.C. and M.-C.T.; formal analysis, C.C.; investigation, C.C. and M.-C.T.; resources, C.-H.C.; data curation, C.C. and M.-C.T.; writing—original draft preparation, C.C. and M.-C.T.; writing—review and editing, C.-H.C.; visualization, C.C. and M.-C.T.; supervision, C.-H.C. and M.-C.T.; project administration, C.-H.C. and M.-C.T.; funding acquisition, C.-H.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

Adamadaptive moment estimation
ANNartificial neuro network
ARautoregressive
ARIMAautoregressive integrated moving average
BBBollinger band
BIASbias lags
DEMDemand index
DIFdifference
DJIDow Jones industrial average
DLdeep learning
EMAexponential moving average
EMHefficient market hypothesis
GEPgene expression programming
GRNNgeneralized regression neural network
GRUgated recurrent units
HSIHang Seng index
Iintegral
IISMintegrated indicator selection method
IVSMintegrated support vector machine
K%Dstochastic line
LAGlag period
LSTMlong short-term memory
MAmoving average
MACDmoving average convergence and divergence
MAPEmean absolute percentage error
MLPmultilayer perceptron
MLPRmultilayer perceptron regression
MOmomentum
Nikkei 225Nikkei average index
OSCOscillator
PROCprice rate of change
PSYpsychological line
RBFradial basis function
RDPrelative differences in percentage
RMSEroot mean square error
RNNrecurrent neural network
RSIrelative strength index
S&P 500Standard & Poor’s index
SSEShanghai Stock Exchange (China A Shares).
SVMsupport vector machine
SVRsupport vector regression
TAIEXTaiwan weighted index
Volumebasic trading volume
WMS%RWilliam indicator

Appendix A

Table A1. Six stock markets [Source: Authors’ own processing].
Table A1. Six stock markets [Source: Authors’ own processing].
Stock IndexDescription
HSIThe HSI is an important indicator that reflects the Hong Kong stock market, and the index is calculated from the market value of fifty constituent stocks of the Hang Seng Index.
TAIEXTAIEX is a weighted index of Taiwan, which is regarded as an indicator of the trend of Taiwan’s economy.
Nikkei 225Nikkei 225 is a stock price index of 225 varieties of the Tokyo Stock Exchange.
S&P 500The US Standard & Poor 500 is the average record of the US stock market since 1957, covering 500 listed companies in the US.
DJIThe Dow Jones industrial average includes the 30 largest and most well-known listed companies in the United States.
SSEThe Shanghai Stock Exchange (SSE) is one of the two Chinese A shares.
Table A2. Technical indicators used in this study [Source: Authors’ own processing].
Table A2. Technical indicators used in this study [Source: Authors’ own processing].
IndicatorDescriptionReference
MA(5) MA(20)Moving average is used to underline the direction of a trend and smooth out price and volume fluctuations, and it is defined in the following:
MA(n) = i = 1 n p r i c e t i n , where n = 5, and 20.
Kannan et al. [57]
BB up
BB down
A Bollinger band defined by a set of trend lines plotted two standard deviations (positively and negatively) away from a simple moving average (MA) of a security’s price.Leung and Chong [20]
RDP(1)The actual closing price is transformed into a relative difference in the percentage of the price, and it is defined in the following formula:
RDP(1) = p r i c e t p r i c e t 1 p r i c e t 1 × 100 .
Tay and Cao [1]
BIAS(6) BIAS(12) BIAS(24)Bias ratio is the difference between closing price and moving average, and it is defined in the following formula:
B I A S t = c l o s e M A t M A t , where t = 6, 12, and 24.
Chang et al. [21]
RSIThe relative strength index shows the most recent stock profit and loss comparison, and the purpose is to determine the overbought and oversold conditions of assets.Tsai et al. [19]
EMA(12) EMA(26)The exponential moving average is calculated by the weighted average from the current price to the past price, and it is defined as follows:
E M A t i = α × p r i c e t + 1 α × p r i c e t + + 1   α i p r i c e t i ,   w h e r e   α = 2 i + 1 ,     i = 12 ,   a n d   26 .
Nakano et al. [58]
MACD (DEM)
DIF
OSC
Moving average convergence/divergence shows the difference between the fast and slow exponential moving average of the closing price, and MACD is composed of three elements: difference (DIF), Demand index (DEM, signal line also called MACD), Oscillator (OSC). They are defined as follows:
DIF = E M A 12 E M A 26 ,   D E M = E M A 9 , and O S C = D I F D E M .
Ahmar [22]
PSY(12) PSY(24) The psychological line is a ratio of rising over a period, and it reflects the purchasing power relative to the sales ability. It is defined as follows:
PSY(N) = the   number   of   rising   days   in   N   days N × 100 , where N = 12, and 24.
Lai et al. [23]
WMS%RWilliams %R is a momentum indicator range from 0 to −100, and it is used to measure overbought and oversold levels. Williams %R can be used to find market entry and exit points, and this indicator is very similar to the stochastic %K and %D.Naik and Mohan [59]
Stochastic K% Stochastic D%Stochastic oscillator %K and %D are momentum indicators, which can show the position relative to the high/low range over a period of time.Chang and Fan [60]
PROCPercentage of price change measures the percentage change in price between the current price and the price of a certain number of periods ago.Anish and Majhi [61]
MO(1)Momentum measures the amount of change in security prices in a given time and displays the rate of change in stock prices, and its formula is defined as follows:
M O 1 = p r i c e t p r i c e t 1 t t 1 .
Tanaka-Yamawaki et al. [62]
LAG(1)The first-order lag period, and the formula is defined as follows:
LAG(1) = Price(t−1).
Chen et al. [12]
VolumeTrading volume is a measure of the completed transactions of specific security within a specific period of time. It measures two very important factors: market activity and liquidity.Ahmar [22]

References

  1. Tay, F.E.H.; Cao, L. Application of support vector machines in financial time series forecasting. Omega 2001, 29, 309–317. [Google Scholar] [CrossRef]
  2. Fama, E.F. Random Walk in Stock Market Prices. Financ. Anal. J. 1995, 51, 75–80. [Google Scholar] [CrossRef] [Green Version]
  3. Abu-Mostafa, Y.S.; Atiya, A.F. Introduction to financial forecasting. Appl. Intell. 1996, 6, 205–213. [Google Scholar] [CrossRef]
  4. Ariyo, A.A.; Adewumi, A.O.; Ayo, C.K. Stock price prediction using the ARIMA model. In Proceedings of the 2014 UKSim-AMSS 16th International Conference on Computer Modelling and Simulation, Cambridge, UK, 26–28 March 2014; pp. 106–112. [Google Scholar] [CrossRef] [Green Version]
  5. Bao, W.; Yue, J.; Rao, Y. A deep learning framework for financial time series using stacked autoencoders and long-short term memory. PLoS ONE 2017, 12, e0180944. [Google Scholar] [CrossRef] [Green Version]
  6. Barak, S.; Modarres, M. Developing an approach to evaluate stocks by forecasting effective features with data mining methods. Expert Syst. Appl. 2015, 42, 1325–1339. [Google Scholar] [CrossRef]
  7. Chen, K.; Zhou, Y.; Dai, F. A LSTM-based method for stock returns prediction: A case study of China stock market. In Proceedings of the 2015 IEEE International Conference on Big Data (Big Data), Santa Clara, CA, USA, 29 October–1 November 2015; pp. 2823–2824. [Google Scholar] [CrossRef]
  8. Chong, E.; Han, C.; Park, F.C. Deep learning networks for stock market analysis and prediction: Methodology, data representations, and case studies. Expert Syst. Appl. 2017, 83, 187–205. [Google Scholar] [CrossRef] [Green Version]
  9. Fischer, T.; Krauss, C. Deep learning with long short-term memory networks for financial market predictions. Eur. J. Oper. Res. 2018, 270, 654–669. [Google Scholar] [CrossRef] [Green Version]
  10. Nassirtoussi, A.K.; Aghabozorgi, S.; Wah, T.Y.; Ngo, D.C.L. Text mining of news-headlines for FOREX market prediction: A multilayer dimension reduction algorithm with semantics and sentiment. Expert Syst. Appl. 2015, 42, 306–324. [Google Scholar] [CrossRef]
  11. Nobre, J.; Neves, R.F. Combining principal component analysis, discrete wavelet transform and XGBoost to trade in the financial markets. Expert Syst. Appl. 2019, 125, 181–194. [Google Scholar] [CrossRef]
  12. Chen, T.L.; Cheng, C.H.; Liu, J.W. A Causal Time-Series Model Based on Multilayer Perceptron Regression for Forecasting Taiwan Stock Index. Int. J. Inf. Technol. Decis. Mak. 2019, 18, 1967–1987. [Google Scholar] [CrossRef]
  13. Franses, P.H.; Ghijsels, H. Additive outliers, GARCH and forecasting volatility. Int. J. Forecast. 1999, 15, 1–9. [Google Scholar] [CrossRef]
  14. Zhang, J.; Xie, Y.; Li, Y.; Shen, C.; Xi, Y. COVID-19 Screening on Chest X-ray Images Using Deep Learning based Anomaly Detection. arXiv 2020, arXiv:2003.12338. [Google Scholar]
  15. Cowles, A., 3rd. Can Stock Market Forecasters Forecast? Econometrica 1933, 1, 309–324. [Google Scholar] [CrossRef] [Green Version]
  16. Neely, C.J.; Rapach, D.E.; Tu, J.; Zhou, G. Forecasting the equity risk premium: The role of technical indicators. Manag. Sci. 2014, 60, 1772–1791. [Google Scholar] [CrossRef] [Green Version]
  17. Peng, Y.; Albuquerque, P.H.M.; Kimura, H.; Saavedra, C.A.P.B. Feature selection and deep neural networks for stock price direction forecasting using technical analysis indicators. Mach. Learn. Appl. 2021, 5, 100060. [Google Scholar] [CrossRef]
  18. Wang, Y.; Liu, L.; Wu, C. Forecasting commodity prices out-of-sample: Can technical indicators help? Int. J. Forecast. 2020, 36, 666–683. [Google Scholar] [CrossRef]
  19. Tsai, C.F.; Lin, Y.C.; Yen, D.C.; Chen, Y.M. Predicting stock returns by classifier ensembles. Appl. Soft Comput. 2011, 11, 2452–2459. [Google Scholar] [CrossRef]
  20. Leung, J.M.J.; Chong, T.T.L. An empirical comparison of moving average envelopes and Bollinger Bands. Appl. Econ. Lett. 2003, 10, 339–341. [Google Scholar] [CrossRef]
  21. Chang, P.C.; Liao, T.W.; Lin, J.J.; Fan, C.Y. A dynamic threshold decision system for stock trading signal detection. Appl. Soft Comput. 2011, 11, 3998–4010. [Google Scholar] [CrossRef]
  22. Ahmar, A.S. Sutte Indicator: A Technical Indicator in Stock Market. Int. J. Econ. Financ. Issues 2017, 7, 223–226. Available online: https://dergipark.org.tr/en/pub/ijefi/issue/32035/354468 (accessed on 10 July 2021).
  23. Lai, H.W.; Chen, C.W.; Huang, C.S. Technical analysis, investment psychology, and liquidity provision: Evidence from the Taiwan stock market. Emerg. Mark. Financ. Trade 2010, 46, 18–38. [Google Scholar] [CrossRef]
  24. Verleysen, M.; François, D. The curse of dimensionality in data mining and time series prediction. In Computational Intelligence and Bioinspired Systems, Proceedings of the International Work-Conference on Artificial Neural Networks, Warsaw, Poland, 10–15 September 2005; Lecture Notes in Computer, Science; Cabestany, J., Prieto, A., Sandoval, F., Eds.; Springer: Berlin/Heidelberg, Germany, 2005; Volume 3512, pp. 758–770. [Google Scholar] [CrossRef]
  25. Chandrashekar, G.; Sahin, F. A survey on feature selection methods. Comput. Electr. Eng. 2014, 40, 16–28. [Google Scholar] [CrossRef]
  26. Guyon, I.; Elisseeff, A. An Introduction of Variable and Feature Selection. J. Mach. Learn. Res. 2003, 3, 1157–1182. [Google Scholar]
  27. Guyon, I.; Weston, J.; Barnhill, S.; Vapnik, V. Gene selection for cancer classification using support vector machines. Mach. Learn. 2002, 46, 389–422. [Google Scholar] [CrossRef]
  28. Van Der Malsburg, C.; Rosenblatt, F. Principles of neurodynamics: Perceptrons and the theory of brain mechanisms. In Brain Theory; Palm, G., Aertsen, A., Eds.; Springer: Berlin/Heidelberg, Germany, 1986; pp. 245–248. [Google Scholar] [CrossRef]
  29. Sezer, O.B.; Gudelek, M.U.; Ozbayoglu, A.M. Financial time series forecasting with deep learning: A systematic literature review: 2005–2019. Appl. Soft Comput. 2020, 90, 106181. [Google Scholar] [CrossRef] [Green Version]
  30. Lee, S.-J.; Tseng, C.-H.; Lin, G.T.–R.; Yang, Y.; Yang, P.; Muhammad, K.; Pandey, H.M. A dimension-reduction based multilayer perception method for supporting the medical decision making. Pattern Recognit. Lett. 2020, 131, 15–22. [Google Scholar] [CrossRef]
  31. Cortes, C.; Vapnik, V. Support vector machine. Mach. Learn. 1995, 20, 273–297. [Google Scholar] [CrossRef]
  32. Yang, H.; Chan, L.; King, I. Support vector machine regression for volatile stock market prediction. In Intelligent Data Engineering and Automated Learning—IDEAL 2002, Proceedings of the International Conference on Intelligent Data Engineering and Automated Learning, Manchester, UK, 24–26 November 2002; Yin, H., Allinson, N., Freeman, R., Keane, J., Hubbard, S., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2002; Volume 2412, p. 2412. [Google Scholar] [CrossRef]
  33. Karmy, J.P.; Maldonado, S. Hierarchical time series forecasting via support vector regression in the European travel retail industry. Expert Syst. Appl. 2019, 137, 59–73. [Google Scholar] [CrossRef]
  34. Crone, S.F.; Guajardo, J.; Weber, R. The impact of preprocessing on support vector regression and neural networks in time series prediction. In Proceedings of the International Conference on Data Mining DMIN’06, Las Vegas, NV, USA, 26–29 June 2006; CSREA: Providence, RI, USA; pp. 37–42. [Google Scholar]
  35. Specht, D.F. A general regression neural network. IEEE Trans. Neural Netw. 1991, 2, 568–576. [Google Scholar] [CrossRef] [Green Version]
  36. Ferreira, C. Gene Expression Programming: A New Adaptive Algorithm for Solving Problems. arXiv 2001, arXiv:0102027. [Google Scholar] [CrossRef]
  37. Wang, B.; Li, T.; Yan, Z.; Zhang, G.; Lu, J. Deep PIPE: A distribution-free uncertainty quantification approach for time series forecasting. Neurocomputing 2020, 397, 11–19. [Google Scholar] [CrossRef]
  38. Box, G.E.P.; Jenkins, G.M. Time Series Analysis: Forecasting and Control; Holden-Day: San Francisco, CA, USA, 1976. [Google Scholar]
  39. Hyndman, R.J.; Athanasopoulos, G. Forecasting: Principles and Practice, 3rd ed.; OTexts: Melbourne, Australia, 2021. [Google Scholar]
  40. Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
  41. Kim, T.; Kim, H.Y. Forecasting stock prices with a feature fusion LSTM-CNN model using different representations of the same data. PLoS ONE 2019, 14, e0212320. [Google Scholar] [CrossRef] [Green Version]
  42. Cho, K.; van Merrienboer, B.; Bahdanau, D.; Bengio, Y. On the properties of neural machine translation: Encoder-decoder approaches. arXiv 2014, arXiv:1409.1259. [Google Scholar] [CrossRef]
  43. Wang, W.; Yang, N.; Wei, F.; Chang, B.; Zhou, M. R-NET: Machine Reading Comprehension with Self-Matching Networks; Technical Report 5; Natural Language Computer Group, Microsoft Research Asia: Beijing, China, 2017. [Google Scholar]
  44. Man, J.; Dong, H.; Yang, X.; Meng, Z.; Jia, L.; Qin, Y.; Xin, G. GCG: Graph Convolutional network and gated recurrent unit method for high-speed train axle temperature forecasting. Mech. Syst. Signal Process. 2022, 163, 108102. [Google Scholar] [CrossRef]
  45. Tan, C.N.W. A hybrid financial trading system incorporating chaos theory, statistical and artificial intelligence/soft computing methods. In Proceedings of the Queensland Finance Conference, Brisbane, Australia, 30 September–1 October 1999; Available online: http://machine-learning.martinsewell.com/ann/Tan99.pdf (accessed on 1 July 2021).
  46. The PyData Development Team, Python Programming Language. Available online: https://pypi.org/project/pandas-datareader/ (accessed on 1 July 2021).
  47. Yahoo Finance. Available online: https://finance.yahoo.com/ (accessed on 10 July 2021).
  48. Financial Transactions Taxes around the World. Available online: https://cepr.net/report/financial-transactions-taxes-around-the-world/ (accessed on 10 November 2022).
  49. Chen, Y.S.; Cheng, C.H.; Chiu, C.L.; Huang, S.T. A study of ANFIS-based multi-factor time series models for forecasting stock index. Appl. Intell. 2016, 45, 277–292. [Google Scholar] [CrossRef]
  50. Chang, C.-C.; Lin, C.-J. LIBSVM: A library for support vector machines. ACM Trans. Intell. Syst. Technol. 2011, 2, 1–27. [Google Scholar] [CrossRef]
  51. Busch, T.; Christensen, B.J.; Nielsen, M.Ø. The role of implied volatility in forecasting future realized volatility and jumps in foreign exchange, stock, and bond markets. J. Econom. 2011, 160, 48–57. [Google Scholar] [CrossRef]
  52. Ending 10-Year Financial Crisis. 2017. Available online: https://www.marketwatch.com/story/financial-crisis-is-now-officially-over-and-heres-the-chart-that-proves-it-2017-12-01 (accessed on 10 July 2021).
  53. China’s Stock Market Crash: One Year Later. 2016. Available online: https://www.forbes.com/sites/sarahsu/2016/07/13/chinas-stock-market-crash-one-year-later/?sh=63a9e1335503 (accessed on 10 July 2021).
  54. LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef]
  55. Shi, Y.; Li, W.; Zhu, L.; Guo, K.; Cambria, E. Stock trading rule discovery with double deep Q-network. Appl. Soft Comput. 2021, 107, 107320. [Google Scholar] [CrossRef]
  56. Du, N.; Yan, Y.; Qin, Z. Analysis of financing strategy in coopetition supply chain with opportunity cost. Eur. J. Oper. Res. 2022, 305, 85–100. [Google Scholar] [CrossRef]
  57. Kannan, K.S.; Sekar, P.S.; Sathik, M.M.; Arumugam, P. Financial stock market forecast using data mining techniques. In Proceedings of the International Multiconference of Engineers and Computer Scientists, Hong Kong, China, 17–19 March 2010. [Google Scholar]
  58. Nakano, M.; Takahashi, A.; Takahashi, S. Generalized exponential moving average (EMA) model with particle filtering and anomaly detection. Expert Syst. Appl. 2017, 73, 187–200. [Google Scholar] [CrossRef]
  59. Naik, N.; Mohan, B.R. Optimal feature selection of technical indicator and stock prediction using machine learning technique. In Proceedings of the International Conference on Emerging Technologies in Computer Engineering, Jaipur, India, 1–2 February 2019; Springer: Singapore, 2019; pp. 261–268. [Google Scholar] [CrossRef]
  60. Chang, P.C.; Fan, C.Y. A hybrid system integrating a wavelet and TSK fuzzy rules for stock price forecasting. IEEE Trans. Syst. Man Cybern. Part C Appl. Rev. 2008, 38, 802–815. [Google Scholar] [CrossRef]
  61. Anish, C.M.; Majhi, B. Hybrid nonlinear adaptive scheme for stock market prediction using feedback FLANN and factor analysis. J. Korean Stat. Soc. 2016, 45, 64–76. [Google Scholar] [CrossRef]
  62. Tanaka-Yamawaki, M.; Tokuoka, S. Adaptive use of technical indicators for the prediction of intra-day stock prices. Phys. A Stat. Mech. Appl. 2007, 383, 125–133. [Google Scholar] [CrossRef]
Figure 1. Proposed computational procedure [Source: Authors’ own processing].
Figure 1. Proposed computational procedure [Source: Authors’ own processing].
Systems 10 00243 g001
Figure 2. Four forecast models vs. actual 2017 data from the DJI [Source: Authors’ own processing].
Figure 2. Four forecast models vs. actual 2017 data from the DJI [Source: Authors’ own processing].
Systems 10 00243 g002
Figure 3. Four forecast models vs. actual 2017 HSI data [Source: Authors’ own processing].
Figure 3. Four forecast models vs. actual 2017 HSI data [Source: Authors’ own processing].
Systems 10 00243 g003
Figure 4. Four forecast models vs. actual 2017 data of the Nikkei 225 [Source: Authors’ own processing].
Figure 4. Four forecast models vs. actual 2017 data of the Nikkei 225 [Source: Authors’ own processing].
Systems 10 00243 g004
Figure 5. Comparative total profits of trading policies 1 and 2 for the six stock markets [Source: Authors’ own processing].
Figure 5. Comparative total profits of trading policies 1 and 2 for the six stock markets [Source: Authors’ own processing].
Systems 10 00243 g005
Table 1. Important indicators selected by five algorithms for the 2019 DJI stock market [Source: Authors’ own processing].
Table 1. Important indicators selected by five algorithms for the 2019 DJI stock market [Source: Authors’ own processing].
IndicatorsSVM-LinearSVM-RBFMLPRGRNNGEPIISM
Volume
MA(5)
MA(20)
BB up
BB down
RSI
EMA(12)
EMA(26)
DIF
DEM
OSC
RDP
BIAS(6)
BIAS(12)
BIAS(24)
PSY(12)
PSY(24)
W%R
%K
%D
PROC
MO(1)
LAG(1)
Note: “✕“ denotes the selected indicator.
Table 2. Parameter setting of the five algorithms [Source: Authors’ own processing].
Table 2. Parameter setting of the five algorithms [Source: Authors’ own processing].
AlgorithmParameterReference
LSTM# layers: [1, 5]; #nodes per layer: [30, 70]; batch size = [64, 128]; activation function: relu; learning rate: [0.001, 0.1]; epochs: [50, 80]; optimizer: Adam.Kim and Kim [41]
GRU# layers: [1, 5]; #nodes per layer: 50; batch size= 100; learning rate: [0.001, 0.1]; epochs = 100; optimizer: Adam.Wang et al. [43]
SVRkernel function: RBF; epsilon = 0.001; gamma = 1/n (n = #variables); C = 1.Chang and Lin [50]
MLPRactivation function: sigmoid; loss function: square error; learning rate = 0.001; hidden layer sizes = 200.Lee et al. [30]
GRNNSpread of radial basis functions = 0.25; batch size = 64; epochs = 50.Specht [35]
Table 3. Frequencies of technical indicators in all 54 datasets [Source: Authors’ own processing].
Table 3. Frequencies of technical indicators in all 54 datasets [Source: Authors’ own processing].
IndicatorDJIS&P 500HSINikkei 225SSETAIEXTotal
LAG99999954
EMA(26)99989953
EMA(12)89989952
MA(5)88789747
BIAS(24)78879544
MO68679642
MA(20)77669641
BB up87739539
BIAS(6)77659539
BB down76639637
DIF56659334
BIAS(12)85449232
DEM54359430
OSC62519427
RDP43229222
%D10019011
PSY(24)01009010
W%R00019010
PROC10009010
PSY(12)0000909
RSI0000909
Volume0000909
%K0000909
Table 4. Descriptive statistics of closing prices for different stock markets [Source: Authors’ own processing].
Table 4. Descriptive statistics of closing prices for different stock markets [Source: Authors’ own processing].
StockYearRangeStandard DeviationMaxMin
DJI20195959.041073.0028,645.2622,686.22
20185036.19829.1726,828.3921,792.20
20175105.111322.0124,837.5119,732.40
20164314.44942.7619,974.6215,660.18
20152645.95554.6918,312.3915,666.44
20142680.91552.7118,053.7115,372.80
20133247.81715.7116,576.6613,328.85
20121508.69319.3913,610.1512,101.46
20112155.24490.4112,810.5410,655.30
S&P 5002019792.13150.673240.022447.89
2018579.65100.412930.752351.10
2017432.33109.422690.162257.83
2016442.64101.432271.721829.08
2015263.2154.892130.821867.61
2014348.6879.572090.571741.89
2013391.2199.241848.361457.15
2012188.7146.631465.771277.06
2011264.3862.551363.611099.23
HSI20195093.131247.3530,157.4925,064.36
20188568.592208.9333,154.1224,585.53
20177869.022134.0130,003.4922,134.47
20165780.121457.0724,099.7018,319.58
20157886.152119.4128,442.7520,556.60
20144135.79912.6225,317.9521,182.16
20134224.57877.1324,038.5519,813.98
20124481.001085.9422,666.5918,185.59
20118169.352196.8124,419.6216,250.27
Nikkei 22520194504.16992.5424,066.1219,561.96
20185114.88855.8024,270.6219,155.74
20174603.551278.8222,939.1818,335.63
20164542.51918.9419,494.5314,952.02
20154072.071073.3620,868.0316,795.96
20144025.48998.4717,935.6413,910.16
20135804.321436.0116,291.3110,486.99
20122099.55487.3910,395.188295.63
20112697.52738.5610,857.538160.01
SSE2019932.18242.613201.552269.37
2018525.64143.532577.602051.96
2017507.63116.282548.302040.67
20161305.66303.043389.402083.74
20152344.22559.225410.863066.64
2014739.56140.373518.542778.98
2013414.04102.663610.863196.82
20121128.30310.973728.352600.05
2011845.47165.053425.902580.43
TAIEX20192739.94569.9712,122.459382.51
20181774.12490.4611,253.119478.99
20171581.69422.6510,854.579272.88
20161728.67445.929392.687664.01
20152562.78605.509973.127410.34
20141304.69302.989569.178264.48
20131006.79227.448623.437616.64
20121249.38296.458144.046894.66
20112512.02765.299145.356633.33
Table 5. Forecast results of full indicators for five forecast models (RMSE) [Source: Authors’ own processing].
Table 5. Forecast results of full indicators for five forecast models (RMSE) [Source: Authors’ own processing].
StockYearLSTMGRUMLPRSVRGRNN
DJI201997.361951.777799.1505226.4525124.4413
201842.028122.576185.8237353.180971.8418
2017173.9153143.5100657.7406157.9160388.5301
2016101.429874.8453443.3431194.2021155.9858
201591.331065.6631169.0027175.3816155.0431
2014135.627472.8003693.756586.8626243.2861
2013213.4277111.6285884.4591171.4828370.3082
2012157.5769107.6936589.092172.2888324.3755
2011163.9555145.9973847.9486108.9804463.2501
SD52.374641.6598313.075884.8945136.8538
S&P 500201910.80716.922414.800731.372613.4845
20189.76088.475116.393737.439311.1921
201720.794417.022275.140416.391232.1713
201612.823811.866848.682021.004123.8996
20158.56254.760516.950913.387712.9853
201415.01909.206749.30759.819230.7069
201318.691515.730970.707611.949624.8363
201218.239812.579681.800211.647839.9090
201118.174022.459698.130918.888166.5393
SD4.45085.558831.22139.509117.3052
HSI2019316.9949217.2492557.9458477.9190212.4031
2018185.365895.9802767.6190433.5593340.4732
2017141.172295.2021300.0138129.3764208.6685
201695.189843.1952223.9472535.1239213.4665
2015184.5437188.1598481.0047604.0904313.1186
2014109.658791.7758433.2478307.7025274.8683
2013224.3597168.72301016.1220306.6685637.5018
2012233.5597191.6585732.3858508.6721372.1900
2011144.024273.4858203.8428533.7443234.6301
SD69.436562.1009273.6097150.4325136.0408
Nikkei 225201957.959949.4894295.3367298.1137127.5387
201883.277353.3905153.3542378.5275130.4394
2017280.9825144.6442774.5934242.1133578.4405
2016211.8529164.1940848.6051294.3882221.5481
2015111.837980.5574211.7121153.1162208.9622
2014133.005989.6691617.4355337.1630348.4478
2013200.3073127.0322856.7085281.9635216.8408
2012236.8379113.0469531.5152174.4274299.8980
2011162.664779.9200570.1168150.0313245.8809
SD74.197039.7276268.020282.2947137.4483
SSE201929.730129.8800102.290046.490249.1010
201816.64009.530056.540533.210536.1930
201712.82037.290214.460619.413025.1405
201680.280074.4705261.6400495.9004124.8202
201555.020550.8807122.010160.94002127.8201
2014125.4506135.050971.02005132.160563.0908
201315.40078.240145.81049.210918.4502
201224.720916.3103164.910228.180855.5603
201121.050210.050522.920315.200123.6804
SD38.222943.115578.732341.152041.4547
TAIEX201988.036769.5280291.3393179.6965126.4247
201824.206120.917679.3684140.072237.6275
201734.611615.333194.662152.025356.1027
201636.702920.009848.857984.036452.4923
201553.981362.668197.3140233.462679.0019
201450.480032.5281133.734972.241062.0565
201348.209428.3626210.310161.7355107.9973
201280.568262.4979217.316862.096773.5255
201188.646052.7298351.2767163.2088207.7405
SD24.060921.2576104.048264.749552.4165
Note: the bold number denotes the minimal RMSE in the five forecast models, and SD denotes the standard deviation.
Table 6. Forecast results of full indicators for five forecast models (MAPE) [Source: Authors’ own processing].
Table 6. Forecast results of full indicators for five forecast models (MAPE) [Source: Authors’ own processing].
StockYearLSTMGRUANNSVRGRNN
DJI20190.10510.11580.65680.70150.7491
20180.19530.15720.45460.77820.4487
20170.33110.26343.64910.62512.3657
20160.29070.24322.14350.83520.6351
20150.09050.07710.84520.81910.7899
20140.18220.20063.36670.43471.1278
20130.64150.74493.18980.89591.2641
20120.09100.06651.62360.41770.9468
20110.11010.10602.67200.74531.6184
SD0.17870.20921.23000.17120.5896
S&P 50020190.15110.20040.95560.97480.8918
20180.16820.16780.75791.04290.6841
20170.39720.35043.80250.59211.6733
20160.13440.14412.03300.69040.9894
20150.05100.05990.63820.47880.5160
20140.20010.19941.99140.46131.2606
20130.72090.68582.46230.64670.8736
20120.48880.53402.31920.61471.0757
20110.11290.09012.85581.13332.0764
SD0.22020.21261.04780.24900.4908
HSI20190.13840.10362.16471.20840.9528
20180.20500.29212.97591.23211.4674
20170.23320.21350.99650.41940.7106
20160.18150.20360.70851.98680.7770
20150.23320.13061.27921.89781.2360
20140.07630.09471.42850.97831.0791
2130.09690.08582.81390.92572.0501
20120.17710.27351.82501.67830.9846
20110.53320.32420.61812.07620.6318
SD0.13380.09160.86410.56480.4425
Nikkei 22520190.16130.14112.54241.08701.3619
20180.21110.12141.16131.13121.1193
20170.27010.27044.80130.88883.5028
20160.40860.26623.82071.22440.9434
20150.10410.12060.87100.65580.7938
20140.56970.35863.11571.71051.6490
20130.99690.93392.46521.72480.6712
20120.39590.42141.50051.29730.9242
20110.21690.16401.70101.28800.7987
SD0.27570.25711.29790.34630.8790
SSE20190.95080.77083.62020.92021.6802
20180.63020.32052.29050.35031.3810
20170.47000.22060.43060.27050.9405
20162.34062.19078.53082.81084.1704
20151.22050.84012.35020.84093.2108
20143.70073.96081.88033.95051.7520
20130.38020.19051.02050.27010.4610
20120.71060.37044.80080.45041.8406
20110.58040.22030.59040.27020.6407
SD1.10471.27422.56111.33211.2082
TAIEX20190.16950.18643.27781.45691.5666
20180.81920.35510.71261.08990.4074
20170.13920.10120.80840.43370.5350
20160.13750.08340.40930.81330.4694
20150.11010.09850.79871.97120.7389
20140.10930.09881.06340.58560.5825
20130.08940.08241.37570.69580.7831
20120.06710.05491.33850.67430.5374
20110.33840.56182.35511.60771.5320
SD0.23810.16970.91500.52950.4440
Note: the bold number denotes the minimal MAPE in the five forecast models, and SD denotes the standard deviation.
Table 7. Comparative forecast results between full and selected indicators (RMSE) [Source: Authors’ own processing].
Table 7. Comparative forecast results between full and selected indicators (RMSE) [Source: Authors’ own processing].
StockYearLSTM-FullGRU-FullLSTM-SelectedGRU-Selected
DJI201997.361951.777739.433018.0759
201842.028122.576162.781840.2506
2017173.9153143.510034.449141.3938
2016101.429874.845342.988430.4705
201591.331065.663136.350213.1950
2014135.627472.800335.250932.6963
2013213.4277111.6285100.2916115.1564
2012157.5769107.693614.659710.8675
2011163.9555145.997323.725727.5259
S&P 500201910.80716.92245.09765.5951
20189.76088.47517.96159.7416
201720.794417.02226.00586.0531
201612.823811.86683.33663.5705
20158.56254.76051.85202.2277
201415.01909.20674.47413.2928
201318.691515.730914.639513.6991
201218.239812.57967.07786.4937
201118.174022.45963.89914.1650
HSI2019316.9949217.249221.114448.3584
2018185.365895.980270.232584.2238
2017141.172295.202170.588269.1719
201695.189843.195228.952832.5897
2015184.5437188.159889.5827114.8543
2014109.658791.775816.822319.8055
2013224.3597168.723026.097624.1908
2012233.5597191.658541.662553.0337
2011144.024273.4858129.452577.7150
Nikkei 225201957.959949.489439.659433.4971
201883.277353.390571.200041.0710
2017280.9825144.644244.626838.6920
2016211.8529164.194034.457327.7233
2015111.837980.557428.256434.6977
2014133.005989.669190.962235.0952
2013200.3073127.0322122.6082119.8622
2012236.8379113.046945.835145.5138
2011162.664779.920032.004719.7709
TAIEX201988.036769.528014.357310.5428
201824.206120.917660.148139.2575
201734.611615.333113.759010.3119
201636.702920.009814.057913.1937
201553.981362.668117.392118.3855
201450.480032.528112.486510.9234
201348.209428.36267.93466.3685
201280.568262.49795.19085.5051
201188.646052.729823.563916.0520
Note: the bold number denotes the minimal RMSE in the five forecast models; the selected indicators are equal to full indicators in SSE, then their forecasts can refer to Table 5.
Table 8. Comparative forecast results between full and selected indicators (MAPE) [Source: Author’s own processing].
Table 8. Comparative forecast results between full and selected indicators (MAPE) [Source: Author’s own processing].
StockYearLSTM-FullGRU-FullLSTM-SelectedGRU-Selected
DJI20190.10510.11580.10330.0501
20180.19530.15720.15600.1067
20170.33110.26340.10790.1454
20160.29070.24320.17870.1240
20150.09050.07710.13580.0557
20140.18220.20060.16830.1583
20130.64150.74490.60430.7138
20120.09100.06650.07990.0683
20110.11010.10600.08570.0893
S&P 50020190.15110.20040.13350.1400
20180.16820.16780.22430.2201
20170.39720.35040.21330.2233
20160.13440.14410.12160.1262
20150.05100.05990.05540.0515
20140.20010.19940.17880.1373
20130.72090.68580.79560.7517
20120.48880.53400.42680.3999
20110.11290.09010.15780.1435
HSI20190.13840.10360.06380.1076
20180.20500.29210.18260.2240
20170.23320.21350.20090.2047
20160.18150.20360.10120.1083
20150.23320.13060.28460.3230
20140.07630.09470.05460.0656
20130.09690.08580.07760.0692
20120.17710.27350.11530.1311
20110.53320.32420.63270.3682
Nikkei 22520190.16130.14110.13630.1093
20180.21110.12140.21250.1433
20170.27010.27040.16240.1229
20160.40860.26620.14960.1180
20150.10410.12060.09680.0837
20140.56970.35860.41200.1755
20130.99690.93390.77530.7625
20120.39590.42140.41550.4266
20110.21690.16400.20830.1130
TAIEX20190.16950.18640.10360.0716
20180.81920.35510.56260.3792
20170.13920.10120.10630.0853
20160.13750.08340.12230.1160
20150.11010.09850.14310.1707
20140.10930.09880.09610.0796
20130.08940.08240.07070.0503
20120.06710.05490.04890.0454
20110.33840.56180.25440.1642
Note: the bold number denotes the minimal MAPE in the five forecast models; the selected indicators are equal to full indicators in SSE, then their forecasts can refer to Table 6.
Table 9. Comparative profits of proposed policy 1 and Chen et al.’s [49] trading policies [Source: Authors’ own processing].
Table 9. Comparative profits of proposed policy 1 and Chen et al.’s [49] trading policies [Source: Authors’ own processing].
Proposed Policy 1Chen et al. [49]
StockYearLSTM-FullGRU-
Full
LSTM-SelectedGRU-
Selected
LSTM-
Full
GRU-
Full
LSTM-SelectedGRU-Selected
DJI20191828.631911.682001.952081.523580.85−74.3917.71
20183966.933966.933930.424172.18−1761.72−1761.72−1961.34−1940.46
20171304.951373.471842.461857.07588.71679.32262.89396.67
20161753.321970.622052.632052.63720.81620.26505.48505.48
20152442.152523.832543.062527.03−192.31142.2695.6948.79
20141533.011609.621649.531635.59−6.42102.36−233.14−192.55
20131181.16647.621197.271110.71945.74899.78994.361008.68
20121310.741328.91302.071327.45−153.88−227.91−79.15−212.08
20112845.552845.552845.552845.55487.71487.71487.71487.71
Total profits18,166.4418,178.2219,364.9419,609.71863.641022.91−1.89119.95
S&P
500
2019180.21182.84200.39206.2656.4544.6145.1914.86
2018389.39368.66382.33381.54−210.01−250.15−252.98−230.61
201793.4697.78129.4126.3574.7191.3987.9173.98
2016200.06217.75202.53214.2565.7254.9366.3776.7
2015273.71271.58276.79279.5620.1510.4519.42−2.44
2014179.03197.42200.92202.510.97−12.69−9.36−2.24
2013104.79106.9681.299.0582.7351.8362.6759.39
2012112.64123.65127.77123.6515.1348.9948.5148.99
2011307.54307.54307.54307.5429.3129.3129.3129.31
Total profits1840.831874.181908.871940.71135.1668.6797.0467.94
HSI20192878.163058.052932.432932.43−276.97−337.24−435.56−435.56
20181442.042707.352327.512327.511007.54245.08281.12281.12
20173277.883634.353685.063653.09949.21421.5164.77462.69
2016825.431164.43802.811072.72292.04−105.18−27.91−45.56
20151362.011567.741896.691698.64−401.41−439.75−1572−623.46
20142700.42575.462708.372404.08−729.01−476.59−460.94159.06
2132315.672382.222613.982627.76−641.34−660.71−758.12−727.59
20121548.581343.781627.591627.591086.021221.071060.11060.1
2011−634.31−729.28−447.14−334.341423.71563.58703.06604.56
Total profits15,715.8617,704.118,147.318,009.482709.781431.77−1145.48735.36
Nikkei
225
20191205.641566.931566.931455.57568.56−29.73−29.73−170.19
20181380.331380.331380.331380.33−844.02−844.02−844.02−844.02
20171840.521838.231982.011982.01−655.92−764.0319.4319.43
20162059.622077.072256.512357.821388.79475.41525.45324.97
20151098.541105.111300.861098.54265.5339.9−124.84265.5
20141427.471427.4718192036.3458.4958.49−110.76−20.66
20132256.071812.012581.672581.671039.681390.03834.88834.88
20121631.51476.851367.581321.53−54.05183.14212.98259.46
2011−59.02−58.8526.3484.72287.02231.32197.79173.06
Total profits12,840.6712,625.1514,281.2314,298.532054.051040.51681.18842.43
SSE2019250.54282.72250.54282.7211.8962.3611.8962.36
2018183.54213.35183.54213.3556.2835.1456.2835.14
2017270.79327.99270.79327.9941.6531.0741.6531.07
2016−19.21−19.21−19.21−19.210000
2015811.58864.26811.58864.26104.45332.34104.45332.34
2014613.8624.07613.8624.07812.45615.36812.45615.36
2013234.96227.43234.96227.43−76.08−83.38−76.08−83.38
2012282.71374.65282.71374.65138.62201.24138.62201.24
201174.04101.7174.04101.71−75.86−176.1−75.86−176.1
Total profits2702.752996.972702.752996.971013.41018.031013.41018.03
TAI
EX
20191066.931066.931141.441165.4985.985.9−84.08−27.04
2018518.36728.57633.34710.03−233.82−158.82−232.62−182.66
2017739.83739.55739.55739.55−278.3−266.04−266.04−266.04
2016797.78759.92759.94759.94264.03385.72293.59293.59
2015811.38858.27910.81910.81−171.34−97.85−255.8−255.8
2014856.22905.73822.03878.43−139.81−97.2−48.31−185.67
2013756.75735.25735.25735.25−96.94−74.88−74.88−74.88
2012860.95860.95893.85893.8512.0512.05−64.45−64.45
2011899.29950.3861.811063.82−532.03−197.26−378−527.5
Total profits7307.497605.477498.027857.17−1090.26−408.38−1110.59−1290.45
Note: the bold number denotes the best profits/total profits in the eight different combined methods.
Table 10. Comparative profits of proposed policy 2 and Chen et al.’s [49] trading policies [Source: Author’s own processing].
Table 10. Comparative profits of proposed policy 2 and Chen et al.’s [49] trading policies [Source: Author’s own processing].
Proposed Policy 2Chen et al. [49]
StockYearLSTM-FullGRU-
Full
LSTM-SelectedGRU-SelectedLSTM-
Full
GRU-
Full
LSTM-SelectedGRU-Selected
DJI2019815.08815.08815.08815.081105.491105.491105.491105.49
20182855.512855.512855.512855.51−1419.78−1419.78−1419.78−2219.14
2017001224.441224.441202.961202.961139.751139.75
20161881.491881.491838.531838.531471.851664.631406.661406.66
20151121.661001.921143.491295.7442.72−7.72−7.72−193.06
2014918.5918.51330.73918.5−8.7−8.7−78.64−8.7
2013635.810635.81635.81926.43937.54926.43926.43
2012504.85373.15504.85504.8523.8860.5960.5960.59
20112498.462498.462498.462498.46922.13922.13922.13532.89
Total profits11,231.3610,344.1112,846.912,586.924266.984457.144054.912750.91
S&P
500
20190000152.51152.51152.51152.51
2018305.3305.3305.3325.47−175.88−145.68−145.68−178.97
2017000093.7693.7693.7693.76
2016169.64167.76151.02151.02128.01128.01123.79123.79
2015142.26142.26142.26142.26−3.2−3.2−3.2−3.2
2014114.72114.72114.72114.7210.4910.4910.4910.49
20130021.14080.4380.4379.1580.43
201286.9186.5976.5476.545.625.625.625.62
2011274.79274.79274.79274.7983.2383.2383.2383.33
Total profits1093.621091.421085.771084.8374.97405.17399.67367.76
HSI20191442.251342.061934.991934.99−271.47−271.47−267.83−616.54
20181062.561062.561062.56803.38652.05120.39120.39120.39
20171117.531574.3424.62424.621357.551147.81357.551357.55
201618.85275.0618.8518.85−500.54−536.71−500.54−500.54
2015563.29614.02614.02457.34−401.1−1002.74−1002.74−913.05
20141279.771481.011481.011481.01−257.49−257.49−257.49−257.49
2131103.921078.541103.921103.92−404.14−404.14−404.14−404.14
20121042.381386.941293.611528.18795.51690.581223.52690.58
2011418.15−986.98−781.59−594.1296.07696.72348.77674.45
Total profits8048.77827.517151.997158.171066.44182.94617.49151.21
Nikkei
225
201928.32280.8328.32440423.55623.69623.69773.38
20181709.291639.181709.292136.43−2634.28−2486.75−2634.28−2572.33
20171233.861004.221153.3603.15−109.13−75.36−203.01−157.33
20162669.312894.12894.12894.11728.31728.31569.641569.64
20151106.941338.861127.461127.4643.9784.28−12.39−161.58
20141295.431702.461276.761702.46−27.31−157.56262.86−112.08
2013884.132245.342205.412285.131838.471550.931550.931550.93
20121083.571083.571083.571083.571135.141135.141135.141135.14
2011124.99−2.33−444.19−2.33−82.05172.59234.36172.59
Total profits10,135.8412,186.2311,034.0212,269.972316.662575.262526.942198.36
SSE2019119.07159.15119.07159.1511.8962.3611.8962.36
2018−69.8540.23−69.8540.2356.2835.1456.2835.14
2017000041.6531.0741.6531.07
2016−19.21−19.21−19.21−19.210000
2015679.14694.13679.14694.13104.45332.34104.45332.34
2014148.76381.47148.76381.47812.45615.36812.45615.36
201390.79172.1890.79172.18−76.08−83.38−76.08−83.38
2012221.84258.75221.84258.75138.62201.24138.62201.24
201156.03−54.9156.03−54.91−75.86−176.1−75.86−176.1
Total profits1226.571631.791226.571631.791013.41018.031013.41018.03
TAI
EX
2019118.61118.61370.82815.08353.11353.11236.36236.36
201831.09183.3831.092855.5155.44−122.0479.2−174.16
20170001224.44−145.65−145.65−145.65−145.65
2016292.02274.03124.731838.53206.51219.63282.41254.82
2015478.14478.14662.211143.49−401.68−401.68−401.68−344.35
2014684.28590.32590.321330.73−33.1160.385.0785.07
2013000635.81257.37257.37257.37196.86
2012551.9641.79551.9504.85310.6367.48300.58367.48
2011326.58550.54341.632498.46−266.33−580.46−713.06−409.22
Total profits2482.622836.812672.712,846.9336.268.06−19.467.21
Note: the bold number denotes the best profits/total profits in the eight different combined methods.
Table 11. Total profits of trading policies 1 and 2 for the six stock markets [Source: Author’s own processing].
Table 11. Total profits of trading policies 1 and 2 for the six stock markets [Source: Author’s own processing].
MarketTrading PolicyTotal ProfitsThe Best Combined Model
DJIPolicy 119,609.71GRU-selected
Policy 212,846.90LSTM-selected
S&P 500Policy 11940.71GRU-selected
Policy 21093.62LSTM-full
HSIPolicy 118,147.30LSTM-selected
Policy 28048.70LSTM-full
Nikkei 225Policy 114,298.53GRU-selected
Policy 212,269.97GRU-selected
SSEPolicy 12996.97GRU-full
Policy 21631.79GRU-full
TAIEXPolicy 17857.17GRU-selected
Policy 212,846.90GRU-selected
Note: the bold number denotes the best total profits in the two proposed trading policies.
Table 12. Opportunity cost computations.
Table 12. Opportunity cost computations.
MarketTotal ProfitsOpportunity Cost2018Opportunity Cost
DJI19,609.71No investing in DJI4172.18No investing in DJI
S&P 5001940.71−17,669.00389.39−3782.79
HSI18,147.30−1462.412707.35−1464.83
Nikkei 22514,298.53−5311.181380.33−2791.85
SSE2996.97−16,612.74213.35−3958.83
TAIEX7857.17−11,752.54728.57−3443.61
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Cheng, C.-H.; Tsai, M.-C.; Chang, C. A Time Series Model Based on Deep Learning and Integrated Indicator Selection Method for Forecasting Stock Prices and Evaluating Trading Profits. Systems 2022, 10, 243. https://doi.org/10.3390/systems10060243

AMA Style

Cheng C-H, Tsai M-C, Chang C. A Time Series Model Based on Deep Learning and Integrated Indicator Selection Method for Forecasting Stock Prices and Evaluating Trading Profits. Systems. 2022; 10(6):243. https://doi.org/10.3390/systems10060243

Chicago/Turabian Style

Cheng, Ching-Hsue, Ming-Chi Tsai, and Chin Chang. 2022. "A Time Series Model Based on Deep Learning and Integrated Indicator Selection Method for Forecasting Stock Prices and Evaluating Trading Profits" Systems 10, no. 6: 243. https://doi.org/10.3390/systems10060243

APA Style

Cheng, C. -H., Tsai, M. -C., & Chang, C. (2022). A Time Series Model Based on Deep Learning and Integrated Indicator Selection Method for Forecasting Stock Prices and Evaluating Trading Profits. Systems, 10(6), 243. https://doi.org/10.3390/systems10060243

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop