Stock price development forecasting using neural networks

. Stock price forecasting is highly important for the entire market economy as well as the investors themselves. However, stock prices develop in a non-linear way. It is therefore rather complicated to accurately forecast their development. A number of authors are now trying to find a suitable tool for forecasting the stock prices. One of such tools is undoubtedly artificial neural network, which have a potential of accurate forecast based even on non-linear data. The objective of this contribution is to use neural networks for forecasting the development of the ČEZ, a. s. stock prices on the Prague Stock Exchange for the next 62 trading days. The data for the forecast have been obtained from the Prague Stock Exchange database. These are final prices at the end of each trading day when the company shares were traded, starting from the beginning of the year 2012 till September 2017. The data are processed by the Statistica software, generating multiple layer perceptron (MLP) and radial basis function (RBF) networks. In total, there are 10,000 neural network structures, out of which 5 with the best characteristics are retained. Using statistical interpretation of the results obtained, it was found that all retained networks are applicable in practice.


Introduction
The ability to accurately predict share price development is crucial for investors in terms of maximising their wealth. Using high-precision forecasting systems, investors are able to make great profits. Share price has a character of a complex non-linear system, along with the changes of internal and external factors operating in the share market. Predicting share prices is a very important topic and is of great importance both for market economy and the aforementioned investors. Share prices development over time is a complex, non-linear and dynamic process and may be predicted using various methods, one of them being artificial neural networks [1]. Neural networks as a highly effective method for data collecting, analysing and predicting have been used for solving a number of various complex problems, including the share prices development prediction [2]. In recent years, artificial neural networks have showed promising results and are still evolving and improving in many respects. However, there are still questions regarding neural networks, which remain unanswered. One of them is the problem of setting the best possible parameters of neural networks [3].
According to Sánchez and Melin [4] artificial neural networks have a wide-range application; they may be applied in various fields and they are becoming more popular due to the rising amount of data and information. Neural networks can be applied for very complex operations which cannot be identified analytically. Therefore, they are used especially for modelling complex strategic decisions [5]. Neural networks are capable of analysing complex patterns very quickly and with high precision and are flexible in terms of their application [6]. They can be used for understanding and generating languages, identifying texts and also for solving time series [7]. Artificial neural networks may thus be used for regression, classification etc. The main advantage is their capability of working with large data sets, accuracy of results or with a simple utilization of the obtained neural network [8].
The main disadvantage is the complexity of creating individual models of artificial neural [9]. It has been mentioned that the great advantage of neural networks is their capability of working with large amount of data. This fact, however, may be a disadvantage. To meet the requirement for large amount of the sample data, a lot of testing observations are required, which is very uncomfortable for users [10].
As a form of artificial intelligence, neural network can fully detect the complex relation between investors and price fluctuations [11]. Therefore, neural networks are starting to be applied for predicting the share prices of individual companies. As for their specific use in the world in recent years, one of them was mentioned by Zheng [12], who designed socalled Elman neural network, a typical regression network applicable for processing sequential data. The network created was used for predicting share price, or their fluctuation. Laboissiere et al. [13] proposed methodology on the basis of artificial neural networks, which is able to predict maximum and minimum share prices of three Brazilian energy companies. Sen and Arup [14] applied models of multilayer perceptron neural networks for predicting share prices of Indian IT companies. Most authors focus on analyzing and predicting share prices development directly on stock exchange, very often in eastern states.
The objective of this contribution is to predict further development of ČEZ share prices on Prague Share Exchange by means of neural networks.

Data and methods
ČEZ, a. s. is one of the most important business entities in the Czech Republic. Its operations, structure, vision and business activities are characterized as follows [15]. "ČEZ group is an integrated energy cluster operating in a number of Central and South-Eastern countries and Turkey, with headquarters in the Czech Republic. Its core business consists of production, distribution, trading and sale in the field of electricity and heat, trading and sale of natural gas and coal mining. ČEZ group currently employs nearly 27,000 employees.
The most significant shareholder of the parent company ČEZ, a. s., is the Czech Republic with a holding in the capital of the company (as of June 14, 2017) of nearly 70 %. The shares of ČEZ, a. s., are traded on Prague and Warsaw Share Exchange, where they are a part of the PX and WIG-CEE share exchange indices.
ČEZ mission is to provide safe, reliable and positive energy to customers as well as the whole company. Its aim is to bring innovations to meet energy needs and thus contribute to a better quality of life. Its strategy reflects the fundamental transformation of European 2 SHS Web of Conferences 39, 01032 (2017) DOI: 10.1051/shsconf/20173901032 IES2017 energy market. ČEZ wants to operate its energy assets in the most efficient way and to adapt to the growing share of decentralized and non-emission production. Another priority is to offer a wide range of products and services for the customers, along with selling electricity and gas. The third priority is to invest actively in prospective energy assets with a focus on the Central European region and in supporting modern technologies at an early stage of their development.
In the Czech Republic, the ČEZ group are active in coal mining, generation and distribution of electricity and heat, trading in electricity and other commodities, sell electricity, heat and natural gas to end-customers and provide other services. The production portfolio consists of nuclear, coal, gas, water, photovoltaic, wind and biogas sources." There are data on share prices between February 2, 2012 and October 9, 2017 available; that is, 1,442 records in total. The data come from the Prague Share Exchange database. These are final prices at the end of each trading day on which the company shares were traded within the given period. The data statistic is showed in Table 1. For the data processing, DELL Statistica V12 will be used. Neural network data mining, specifically time series (regression) will be used. We will choose time as an independent variable and company share price as a dependent variable.
Multiple layer perceptron (MLP) and radial basis function (RBF) networks will be generated. Time series will be divided into three setstraining, testing and validation. The first set will contain 70% of the input data. On the basis of the training data set, neural structures will be generated. In the two remaining data sets, 15% of the input data will be retained. Both sets will be used for verification of the reliability of the generated neural structure, or the model created. The delay of the time series will be 1. We will generate 10,000 neural networks, out of which 5 with the best characteristics 1 will be retained. In the hidden layer, there will be at least 2 but no more than 20 neurons. In case of radial basis function, in the hidden layer there will be at least 21 but no more than 30 neurons. In case of multiple layer perceptron networks, the following activation functions in the hidden and output layers will be considered:  Linear,  Logistic,  Atanh,  Exponential,  Sinus. Other settings will remain default (according to the ANN toolautomated neural network). In case of inadequate results, these can be subsequently modified by adjusting the weight of the individual neurons within the structure.
As soon as the neural networks are generated, their validity will be evaluated expertly, not only based on statistical characteristics. In ideal case, we could be able to use confrontation of predictions. The development of share prices will be predicted for the following 62 days on which the shares will be traded. Table 2 shows 5 neural networks with the best characteristics out of the 10,000 generated st ructures. As seen from Table 2, all retained neural networks are multiple layer perceptron networks (MLP). This means that the radial basis function networks meet the requirements for parameters of performance and error worse than those of the retained neural network. All the networks were generated by means of Quasi-Newton algorithm (each time with a different version). For activating the neurons in the hidden layer, two functions are usedhyperbolic tangent and logistic function. As for the neurons in the output layer, two functions are used for their activation as welllogistic and Identity functions.

Results
The performance of the neural network is described by means of correlation coefficient. The correlation coefficients of all retained networks and data sets are listed in Table 3. We are searching for a neural network with a correlation coefficient as close as possible to 1. The performance of all three data sets should be similar in ideal case. That means that the structure which was generated by means of training data set is valid and has been verified on two other data sets. The value of all neural structures and data sets correlation coefficients is always higher than 0.997. There are minimal differences between the individual neural structures. What is important in this case is the analysis of the predictions statistic (for further details, see Table 4). Judging by the predictions statistic for the individual neural networks, it may be concluded that the differences between the networks are minimal, which holds true for all the statistics.
The correct result could be predicted based on the graphical development of prices and predictions. Figure 1 shows a graphical comparison of the actual ČEZ share prices and prediction of those calculated by means of neural networks.   The graph shows a certain variance of future predictions. The question is how significant the variance is. At this point, an obvious decline of share prices can be seen, starting after October 9, 2017.  Table 5 shows selected cases of predictions in detail. Specifically, it is about every tenth case.  Table 5 shows that the 1st and 2nd neural networks show the same pattern. It is always the minimal level of predictions at a given time. Other predictions are of higher values. Table 5 also shows a summary of minimum and maximum predictions of a given case. It also calculates the difference between minimum and maximum predictions. The difference is subsequently compared with the maximum prediction and expressed as a percentage of the difference to the maximum prediction. This way, we find out that the difference between minimum and maximum prediction is somewhere between 1.06 and 2.26%.

Conclusion
The objective of the contribution was to predict the future development of ČEZ share prices on Prague Stock Exchange by means of neural networks.
First, the data set was analysed. Subsequently, neural networks were generated, out of which five with the best characteristics were retained. By means of statistical interpretation of the results, it was found that all of them are applicable in practice. The differences at the level of one share price are low. However, with the greatest difference between the minimum and maximum predict, the deviation is 2.26%. At the level of one share price, this may not be significant, but when buying or selling a higher number of shares, the difference may appear to be important. I therefore recommend two networks to be used in practice: MLP 1-2-1 (the first network) and MLP 1-5-1 (the fourth network). The first neural network always represents a pessimistic, minimum prediction (as the second neural network does). The fourth network then represents an optimistic, maximum prediction. The real situation is supposed to be found between the optimistic and pessimistic prediction.
It can therefore be concluded that the objective of the contribution was achieved.