Stock market trading has been considered as a volatile ... on stock market forecasting involves artificial intelligence techniques and real time ... Stochastic Oscillator ... MACD. Relative Strength Index. Upside/Downside Ratio. Momentum. TRIX.
Identifying Technical Indicators for Stock Market Prediction With Neural Networks Gary R. Weckman and Sriram Lakshminarayanan Industrial & Manufacturing Systems Engineering Ohio University Athens, Ohio 45701, USA Abstract Stock markets are dynamic systems that are most often influenced by complex factors. Some of these factors may be interrelated like the closing price of stock, high price, low price, and volume of the stock that was traded. Currently a multitude of indicators are used for stock market forecasting. Neural network models for stock market forecasting have been successfully used and are gaining importance in the financial sectors. Typically a stock market data set consists of high noise and is a very complex model incorporating a lot of indicators. This paper deals with initially applying most known indicators to a neural network model and analyzing the performance of the network. Then sensitivity analysis is carried on the indicators and some of the indicators are rejected. In the current set of indicators, some of the indicators are omitted and a few of the rejected indicators are added to a network. The model is tested again for performance and the effect of the absence of certain indicators are noted and thus groups of indicators may be formed. These groups essentially denote the sets of redundant indicators. Applying this procedure reduces the complexity of the network without a compromise in performance and also suggests essential indicators that have to be added to a model to make it competitive in terms of performance.
Keywords Financial Forecasting, Self Organizing maps, Technical Indicators
1. Introduction Stock market forecasting involves the analysis of several hundred indicators to augment the decision making process. Stock market indicators are mostly statistical in nature and some are very similar in nature. Analysts are required to identify indicators that are useful to them by a rigorous trial and error method that may be time consuming and may have some undesired financial repercussions [1]. Stock market trading has been considered as a volatile business and traders have generally resorted to two broad types of analysis use of traditional and proven indicators and recognition and interpretation of patterns and charts. Use of the former technique provides mediocre accuracy but with a high confidence limit and the latter provides high accuracy with low confidence limit. The current research on stock market forecasting involves artificial intelligence techniques and real time computing to utilize the advantages of the above mentioned traditional techniques and provide an accurate forecast with a high confidence limit. The analysis requires high computing power and a considerable amount of time for developing the model [6]. Artificial Neural Networks has been used by several researchers for developing applications to help make more informed financial decisions [5]. Traditional neural networks do a reasonably good job of predicting stock market price motion, with buy/sell prediction accuracies usually falling in the 60-65% range. This performance is being improved by adding more complexity to the network architecture and using more historical data. Different types of network architectures such as Multi Layer Perceptrons, Generalized Feed forward networks, Radial Basis Functions are being tested for higher accuracy. Many researchers are also investigating the possibility of adding additional indicators that may help the Neural Network improve training and performance while testing on production data. Constructive neural networks show excellent potential for improvement due to their “real time iterative output analysis” features.
2. Indicators Indicators are mathematical/statistical functions that are applied over stock properties such as close, high, low and volume. These indicators are broadly classified into the following important categories: • Market Momentum Indicators • Market volatility Indicators • Market Trend Indicators • Broad Market Indicators • General Momentum Indicators Analysts generally use at least one indicator from each of these categories for their forecasts [2]. The method of choosing the indicator is generally by evaluating the accuracy of the model. Most often many indicators are over looked and a good model may never be dis covered for that particular stock. A common misconception with those new to neural networks is that the more inputs you give a neural network, the more information it has and the better the resulting model will be. If the input data is not relevant to the desired output, the network will have a more difficult time learning the associations between the relevant inputs and the desired output. The first is to use a set of indicators commonly used in traditional technical analysis [9]. Another approach is to use the correlation analysis. Correlation Analysis is useful for searching for linear relationships between the desired output and a set of proposed inputs. Specifically, correlation analysis determines if an input and the desired output move in the same [6] direction by similar amounts. Using inputs with high (positive or negative) correlation values will often produce good models. Table 1 Input Indicators to SOM Accumu lation/Distribution Average Directional Movement Chaikin Oscillator Commodity Channel Index Commodity Channel Index (General) Directional Movement Index Directional Movement Rating Ease of Movement Herrick Payoff Index Minus Directional Indicator Money Flow Index Money Flow Index (General) On Balance Volume Plus Directional Indicator Open-10 TRIN Upside/Downside Ratio Acceleration Keltner Channel (Bottom)
QStick Indicator Stochastic Oscillator Williams' %R Williams' Accumulation/Distribution Average True Range Average True Range Band (Bottom) Average True Range Band (Top) Beta Beta On Decrease Beta On Increase Bollinger Band (Bottom) Bollinger Band (Top) Chaikin's Volatility Price and Volume Trend MACD Momentum Rate-of-Change Relative Momentum Index
Mass Index Trading Band (Bottom) Trading Band (Top) True Range Aroon Down Aroon Up Market Facilitation Index Negative Volume Index Positive Volume Index Time Series Forecast Vertical Horizontal Filter Absolute Breadth Index Absolute Breadth Index (Percent) New Highs/Lows Ratio Relative Strength Index TRIX Value Oscillator Velocity
3. Neural Networks An artificial neural network (ANN) may be defined as an information-processing paradigm inspired by the methods by which the mammalian brain processes information. Artificial neural networks are a conglomeration of mathematical models that imitate some of the observed properties of biological nervous systems, most importantly adaptive biological learning. One unique and essential property of the ANN paradigm is the unique structure of the information processing system [3]. It is made of a large number of highly interconnected processing elements that are analogous to neurons and are bound by weighted connections that are similar to synapses. Learning in biological systems may be thought of as adjustments to the synaptic connections that exist between the neurons. Learning or training in a ANN is brought about by exposure to a validated set of input/output data where
the training algorithm iteratively adjusts the connection weights [8]. These connection weights store the knowledge learnt by the network and are necessary to solve specific problems. ANNs have been around since the late 1950’s; but it wasn't until the mid-1980’s that algorithms became sophisticated enough for general applications. Today ANNs are being applied to an increasing number of real- world problems of considerable complexity. They are good pattern recognition engines and robust classifiers, with the ability to generalize in making decisions about imprecise input data. They offer ideal solutions to a variety of classification problems such as speech, character and signal recognition, as well as functional prediction and system modeling where the physical processes are not understood or are highly complex [4]. ANNs may also be applied to control problems, where the input variables are measurements used to drive an output actuator, and the network learns the control function. A key advantage of ANNs lies in their resilience against distortions in the input data and their capability of learning [3]. They are often good at solving problems that are too complex for conventional technologies (e.g., problems that do not have an algorithmic solution or the algorithmic solution is too complex to be found) and are often well suited to problems that people are good at solving, but for which traditional methods are not [11]. Some popular network architectures are the multilayer perceptron which is generally trained with the back propagation of error algorithm, learning vector quantization, radial basis function, Hopfield, and Kohonen, etc. Some ANNs are classified as feedforward while others maybe recurrent (i.e., implement feedback) depending on the method by which data is processed through the network. Another popular method of classifying ANNs is by the method in which they learn (or training), as some ANNs employ supervised training while others utilize unsupervised or selforganizing. Unsupervised algorithms essentially perform clustering of the data into similar groups based on the measured attributes or features serving as inputs to the algorithms.
4. Self Organizing Maps One of the most important issues in pattern recognition is feature extraction. Since this is such a crucial step, different techniques may provide a better fit to our problem. The ideas of Self Organizing Maps [5] are rooted in competitive learning networks. These nets are one layer nets with linear processing elements but use a competitive learning rule. In such nets there is one and only one winning element for every input pattern (i.e. the element whose weights are closest to the input pattern). Kohonen proposed a slight modification of this principle with tremendous implications. Instead of updating only the winning element, in Self Organizing Map nets the neighboring element weights are also updated with a smaller step size. This implies that in the learning process (topological) neighborhood relationships are created in which the spatial locations correspond to features of the input data. The data points that are similar in input space are mapped to small neighborhoods in Kohonen’s Self Organizing Map layer. The Self Organizing Map layer can be a one or two-dimensional lattice, and the size of the net provides the resolution for the lattice. The indicators mentioned in Table 1 are fed as input to a self-organizing map neural network. All neural networks that are implemented for this problem were developed using NeuroSolutions. The indicators are decomposed based on their formulae and the presence or absence of a particular property is noted. The properties checked for are close, high, low, period and volume and are coded in a binary fashion [10]. The self-organizing map based on the presence or absence of the properties, as shown in Figure 1, clusters the indicators. The clusters are then analyzed and indicators are chosen that are close to the cluster center. The chosen indicators are shown in Table 2.
Figure1 Self Organizing Map
Table 2 Indicators selected by SOM Market Momentum Indicators
Market Volatility Indicators
Market Trend Indicators Broad Market Indicators General Momentum Indicators
Money Flow Index Chaikin Oscillator Williams %R Mass Index Bollinger Band Trading Band (top) Aroon Down Aroon Up STIX TRIX Relative Momentum Index
The values for the chosen indicators are then calculated for the Ford Motor Company data. These are the inputs to the generalized feed forward network as indicated in Figure 2. This network is run for a 1000 epochs and five times. The best weights after cross validation was saved. The testing data was run over the network with the saved weights and the results were noted. This methodology may be depicted as a flow of operations as shown in Figure 3.
Figure 2 Generalized Feed Forward Network
Figure 3 Flow Chart of Methodology
5. Data and Network Properties The data used in this research was the closing prices of Ford Motor Company during the financial year 2002-2003. The data was obtained from Trading Solutions distributed by Neurodimension Inc. All the mentioned indicators were calculated on this data set. Self Organizing Map: Input Layer Processing elements: 113 Output Layer Processing elements: 49 Number of Exemplars: 56 Output Axon: Winner Take All
Generalized Feed Forward: Input Layer Processing elements: 16 Hidden Layer Processing elements: 4 Output Layer Processing elements: 1 Number of Exemplars: 253 Hidden & Output Axon: Tanh
6. Results and Conclusions The GFN network, after training was implemented on the test data and the results were noted down. They were found to have a very low mean square error and a very high linear correlation coefficient. This indicates a superior trained network over 253 exemplars. The cross validation coefficients were also found to be very low indicative of a well trained network. It has been a common misconception that a large number of indicators yield in a superior network and more accurate results [7]. An optimal number of indicators are required by the network for reduced complexity and for the eliminating the problem of over learning [11]. This thumb rule for stock market forecasting using neural networks has been applied and the results were found to be superior to previous research by the authors on the same field. Table 3: Performance of Generalized Feed Forward Network Performance MSE NMSE MAE Min Abs Error Max Abs Error R
Close 0.014387384 0.008859906 0.096279288 0.000802536 0.278307152 0.995749053
Close
Desired Output and Actual Network Output 12 11.5 11 10.5 10 9.5 9 8.5 8 7.5 7 6.5 6 1
5
9
13
17
21
25
29
33
37
41
45
49
Days Close
Close Output
Figure 4 Graph of Actual Vs. Output Closing Price
References 1.
2.
3. 4. 5. 6. 7. 8.
9. 10. 11. 12.
13. 14.
Agarwala, R, Weckman, G. R., and McLauchlan, R., 2002, “Optimization of Data Collection and Training Time for Forecasting Stock Market Trends Using Artificial Neural Network”, Proceedings of the 2002 Artificial Neural Networks in Engineering Conference (ANNIE ’02), ASME, St. Louis, Missouri, pp. 707-712. Bogullu, V.K., Enke, D., and Dagli, C., 2002, “Using Neural Networks and Technical Indicators for Generating Stock Trading Signals”, Proceedings of the 2002 Artificial Neural Networks in Engineering Conference (ANNIE ’02), ASME, St. Louis, Missouri, pp. 721-726. Gately, Edward, 1996, Neural Networks for Financial Forecasting, New York, Wiley. Kohara, Ishikawa, and Fukuhara, Nakamura, 1997, “Stock price prediction using prior knowledge and neural networks”, International Journal of Intelligent Systems in Accounting, Finance and Management, 6 (1), pp. 11-22. Kohonen T. "The self-organizing map." Proc. IEEE 78, 1464-1480, 1990. Kyoung-jae, Kim, and Ingoo, Han, 2000, “Genetic algorithms approach to feature discretization in artificial neural networks for the prediction of stock price index”, Expert System with Applications, 19 (2), pp. 125-132. Lee, K. H., and Jo, G. S., 1999, “Exp ert System for predicting stock market timing using candlestick chart”, Expert Systems with Applications, 16, pp. 357-364. Saad, E. W., Prokhorov, D. V., and Wunsch, D. C., 1998, “Comparative study of stock trend prediction using time delay, recurrent and probabilistic neural networks”, IEEE Transactions on Neural Networks, Vol. 9, No. 6, pp. 1456-1470. Shadbolt, J., and Taylor, J.G., 2002, Neural Networks and the Financial Markets: Predicting, Combining and Portfolio Optimization, Springer, New York. Smith, K. A., and Gupta, J. N. D., 2000, “Neural networks in business: techniques and applications for the operations researcher”, Computer& Operations Research, 27, pp. 1023-1044. Strand, Sverre, 1999, “Forecasting the future: pitfalls in controlling for uncertainty”, Futures, 31, 333-350. Thawornwong, S., Enke, D., and Dagli, C., 2001, “Using Neural Networks and Technical Analysis Indicators for Predicting Stock Trends”, Proceedings of the 2001 Artificial Neural Networks in Engineering Conference (ANNIE ’01), ASME, St. Louis, Missouri. Turban, E., and J. E. Aronson, 2001, Decision Support Systems and Intelligent Systems, Sixth Edition, Prentice Hall, New Jersey. Weckman, G. R., and Agarwala, R., 2003, ‘Identifying Relative Contribution of Selected Technical Indicators in Stock Market Prediction” Proceedings of the IIE Annual Conference 2002, May 18-21, Portland, Oregon.