1. Introduction
Stocks are the mainstay of the capital markets and the most important investment tools in them. Stock prices are affected by many financial and non-financial influences in a way that is difficult to enumerate, which makes their prices fluctuate instantaneously and continuously. Investing in stocks is one of the most important investment decisions faced by investors. Deciding whether to buy or sell shares is not an easy task as it is related to an uncertain future. Therefore, it has become necessary to make predictions about stock prices in the future, so that the investor can be guided in making his investment decision. The predictive methods used varied and ranged from simple methods that depend on personal estimates to those that rely on statistical and mathematical methods. The autoregressive model and the moving average (ARIMA) were used in (1987) to predict stock indices [1], the multiple regression model was also used in (1990) to predict the direction of the market index [2], and the autoregressive conditional heteroskedasticity model was used in (2005) to predict the fluctuations of stock returns [3]. Despite the results achieved by these methods, they failed to model some time series of stock prices, in addition to requiring the time series to be stable in order to predict them. As a result, there has been an interest in using methods based on machine learning and artificial intelligence as improved methods. Some machine learning techniques were used (2007) to predict stock prices [4], and the support vector regression model was used (2013) to predict the direction of price movement [5]. Artificial neural networks are one of the techniques of artificial intelligence, as its origins go back to (1940) when McCulloch and Pitts developed a computational model of the neural network [6]. Artificial neural networks have been used to solve numerous problems such as classification, processing, and clustering, as well as time series prediction. It has recently been widely used in forecasting stock returns and capital market fluctuations due to its speed and ease of data processing. This paper proposes an analytical study to test artificial neural networks' ability to predict closing prices for top-six traded industrial stocks listed on Iraq Stock Exchange (ISX). The main goal of this work is to develop predictive models that can be used to guide investment decisions. To achieve that, the paper was organized as follows. Section (2) covered the literature reviews of related works. Section (3) provides a brief knowledge of artificial neural networks. Section (4) presented the methodology and data of this study. Section (5) showed the results and discussion of the experimental study. Finally, Section (6) summarized the conclusion of the study.
2. Related Work
There are several works that experimented with neural networks for stock prediction. Guresen et al (2011) evaluated a Multi-layer perceptron neural network (MLP) along with a dynamic artificial neural network (DAN2) and GARCH model in stock prediction of the NASDAQ index [7]. Bing et al (2012) applied Backpropagation neural network to predict the Shanghai stock exchange composite index. The empirical study conducted on the Shanghai stock exchange composite index is predictable in the short term [8]. Yetis et al (2014) used generalized feedforward neural network model to predict the NASDAQ index, the results demonstrated good performance [9]. Chen et al (2015) evaluated various techniques of machine learning such as LSTM Neural networks, Support vector machines, and Genetic algorithms for predicting Chain stock returns. The results proved the power of LSTM in sequence learning for predicting China's stock market [10]. Billah et al (2017) experimented with ANN based model with an improved Levenberg Marquardt (LM) algorithm compared with the Adaptive Neuro-Fuzzy Inference System (ANFIS) to predict the close price. Comparison results showed that the LM algorithm can predict the close price with less error than ANFIS [11]. Hiransha et al (2018) used four architectures of neural networks, i.e MLP, RNN, LSTM, and CNN for predicting the stock price in NSE and NYSE exchanges. The empirical study demonstrated that CNN is outperforming other architectures. The results obtained have been compared with the ARIM model, It proved that ANN is outperforming the ARIMA model [12]. Teixeira et al (2020) presented a comparative study of five architectures of ANNs, i.e multiple linear regression, Jorden, Elman, Radial basis function, and multilayer perceptron for predicting the six most traded stocks of the Brazilian stock exchange. The results showed that all architectures considered, except RBF, provide suitable reasonable predictions [13]. Shahvaroughi et al (2021) experimented ANN-based model that has been trained using metaheuristic algorithms such as bat algorithm (BA), social spider optimization (SSO), and Genetic algorithm beside ARIMA model to predict stock price indices. The results obtained were compared to each other [14].
3. Artificial Neural Networks Overview
ANN is one of the techniques of machine learning, and its core idea is to try to simulate the biological cells of the human brain and take advantage of its working mechanism in wide fields. Neural networks are used today in the fields of processing, classification, analysis, and prediction [15]. ANN is regarded as a non-linear statistical data tool. The complex relationship between outputs and inputs can be modeled using ANN. The main advantage of ANN is its ability to learn underlying patterns from data, which most conventional methods fail to do [16]. There are many styles of neural networks used in prediction. In this work Multilayer perceptron (MLP) is considered. Figure (1) illustrates the MLP basic architecture.
Multilayer perceptron (MLP) is a feedforward neural network in which data flows unidirectionally from the input layer to the output layer via hidden layers [17]. The layers of the neural network are connected to each other by weights. The activation function of perception in the same layer is the same. It is either a sigmoid or a hyperbolic tangent for the hidden layers in general. The output layer can be a sigmoid or a linear function depending on the application [18]. The role of the activation function is to calculate the response of a neuron, as the weighted inputs can be infinite. Thus deciding whether a neuron should be activated or not, then it bounds the net input value [19]. Backpropagation, which is a generalization of the Least Mean Squared rule, is one of the most wellknown learning algorithms used in MLP [20]. Backpropagation is a weight-correction technique that involves propagating errors from one layer to the next, beginning with the output layer and working backward. The backpropagation algorithm is based on the following five derived equations, which are known as deriving the gradients [21].
β Partial derivatives
β The error of final layer
β The error of hidden layer
β Adding the partial derivatives of each input-output pair
β Updating the weights
The forward propagation and backward propagation processes are repeated repeatedly in the training process of neural networks to minimize the error function [22]. Once the minimum error function is reached, the training process stops, and the link weights are generalized between the layers [23]. There are several techniques for conditional stopping of the training process, such as early stopping depending number of epochs. Continuing to train does not always guarantee improved results; in fact, it is more likely that the opposite will occur, as increasing training times can lead to overfitting [24].
4. Methodology and Data
4.1 Row Data
Raw data were acquired from Iraq stock exchange (ISX) [25], representing the historical data of top-six traded industrial ISX-listed stocks from (2/1/2019) to (24/12/2020). The data are some daily indices consists seven independent variables, which are Open, High, Low, Present rate, Last rate, Change rate, and Volume as well. The dependent variable is Close price to be predicted.
4.2 Proposed Work
To build MLP model, Matlab 2014b nntool was used [26]. The data were divided into training, testing, and validation sets by 70%, 15%, and 15% respectively, then normalized for training performance enhancement. MLP settings have been set to contain 1000 as maximum epochs, logistic function as activation, Mean squared error as performance metrics, and Levenberg-Marquardt was used as a training algorithm. Table (1) shows MLP settings.
Several attempts were made to determine the optimal neural network architecture. Experiments have revealed that the best architecture consists of a single input layer including (8) neurons representing inputs, a single hidden layer with (10) neurons, and a single output representing predicted closing price. Figure (2) shows the MLP model architecture.
5. Results and Discussion
To evaluate the performance of predictive models, some statistical metrics were used. The six MLP models are subjected to Mean squared error (MSE), Root mean squared error (RMSE), and R squared (R2). Their formulas are shown as follows.
Here, Oi refers to the actual closing price; Fi refers to the predicted closing price; and N refers to the sample.
Here, N refers to the total number of sample; yi and Ε·i represent the actual price and predicted price respectively; Θ³i refers to the mean of actual price.
Table (2) shows the results of evaluating the performance of used MLP models for each stock. Although the length of the stock time series varies, the results clearly demonstrated the high accuracy of the models. It is clear from the results that Al-Hilal Co. stock model was the most accurate with (5.64E-06) MSE, (0.002) RMSE, and (0.99) R2. Chemical & Plastic Co. stock model was the last place in model accuracy with (2.78E-04) MSE, (0.016) RMSE, and (0.99) R2. In general, the results proved that all models are highly accurate, where MSE and RMSE metrics near zero for each. On the other hand, for all, the R2 was close to one. Figure (3) illustrates the regression curve of the models.
(A) Metallurgical & bicycle industry (B) Kendiy vaccines
(C) Dates packaging & marketing (E) Al-Hillal industry
(E) Baghdad soft drinks (F) Chemical and plastic industry
Figure (4) below shows the predicted values versus the actual values. It shows how well the predicted values match the actual ones for all stocks. This proves the accuracy of the models.
(A) Metallurgical & bicycle industry
(B) Kendiy vaccines
(C) Dates packaging & marketing
(D) Al-Hillal industry
(E) Baghdad soft drinks
(F) Chemical and plastic industry
6. Conclusion
Decision making for investing in stocks is a complex challenge that investors face. As a result, it necessitates making future predictions to serve as a guide. Because of the rapid fluctuations in stock prices, most traditional models fail to predict them. In this paper, we propose an artificial neural network-based model for predicting the closing prices of top-six traded industrial ISX-listed stocks. ANN have the advantage of not requiring any prerequisites for time series stability. Experimentation has shown that increasing the training times improves model accuracy, but not always, as overfitting can occur. The empirical study demonstrated neural networks' high accuracy in time series modelling of closing prices for six stocks. This confirms the feasibility of using neural networks to predict stock prices on the Iraqi Stock Exchange, and thus their use in investment decision making. We recommend experimenting with other ANN architectures and adding multiple variables in the future..
Funding: βThis research received no external fundingβ
Conflicts of Interest: βThe authors declare no conflict of interest.β