PREDICTION OF CLOSING PRICES ON THE STOCK EXCHANGE WITH THE USE OF ARTIFICIAL NEURAL NETWORKS

Similar documents
The influence of using fractal analysis in hybrid MLP model for short-term forecast of close prices on Warsaw Stock Exchange

This copy is for personal use only - distribution prohibited.

Stock Trading Following Stock Price Index Movement Classification Using Machine Learning Techniques

Neuro-Genetic System for DAX Index Prediction

APPLICATION OF ARTIFICIAL NEURAL NETWORK SUPPORTING THE PROCESS OF PORTFOLIO MANAGEMENT IN TERMS OF TIME INVESTMENT ON THE WARSAW STOCK EXCHANGE

An enhanced artificial neural network for stock price predications

LITERATURE REVIEW. can mimic the brain. A neural network consists of an interconnected nnected group of

A Novel Prediction Method for Stock Index Applying Grey Theory and Neural Networks

STOCK MARKET PREDICTION AND ANALYSIS USING MACHINE LEARNING

STOCK MARKET TRENDS PREDICTION USING NEURAL NETWORK BASED HYBRID MODEL

The Use of Artificial Neural Network for Forecasting of FTSE Bursa Malaysia KLCI Stock Price Index

Electrical. load forecasting using artificial neural network kohonen methode. Galang Jiwo Syeto / EEPIS-ITS ITS

Based on BP Neural Network Stock Prediction

Forecasting stock market prices

International Journal of Computer Engineering and Applications, Volume XII, Issue II, Feb. 18, ISSN

Application of Innovations Feedback Neural Networks in the Prediction of Ups and Downs Value of Stock Market *

CHAPTER V TIME SERIES IN DATA MINING

Design and implementation of artificial neural network system for stock market prediction (A case study of first bank of Nigeria PLC Shares)

Neural Network Prediction of Stock Price Trend Based on RS with Entropy Discretization

Journal of Internet Banking and Commerce

Two kinds of neural networks, a feed forward multi layer Perceptron (MLP)[1,3] and an Elman recurrent network[5], are used to predict a company's

OSCILLATORS. TradeSmart Education Center

Predicting the stock price companies using artificial neural networks (ANN) method (Case Study: National Iranian Copper Industries Company)

Stock market price index return forecasting using ANN. Gunter Senyurt, Abdulhamit Subasi

Business Strategies in Credit Rating and the Control of Misclassification Costs in Neural Network Predictions

International Journal of Research in Engineering Technology - Volume 2 Issue 5, July - August 2017

Performance analysis of Neural Network Algorithms on Stock Market Forecasting

SURVEY OF MACHINE LEARNING TECHNIQUES FOR STOCK MARKET ANALYSIS

Dr. P. O. Asagba Computer Science Department, Faculty of Science, University of Port Harcourt, Port Harcourt, PMB 5323, Choba, Nigeria

International Journal of Computer Engineering and Applications, Volume XII, Issue II, Feb. 18, ISSN

STOCK PRICE PREDICTION: KOHONEN VERSUS BACKPROPAGATION

Keywords: artificial neural network, backpropagtion algorithm, derived parameter.

The Use of Neural Networks in the Prediction of the Stock Exchange of Thailand (SET) Index

Statistical and Machine Learning Approach in Forex Prediction Based on Empirical Data

Price Pattern Detection using Finite State Machines with Fuzzy Transitions

Prediction Models of Financial Markets Based on Multiregression Algorithms

OPENING RANGE BREAKOUT STOCK TRADING ALGORITHMIC MODEL

2015, IJARCSSE All Rights Reserved Page 66

Data based stock portfolio construction using Computational Intelligence

Research Article Design and Explanation of the Credit Ratings of Customers Model Using Neural Networks

Shynkevich, Y, McGinnity, M, Coleman, S, Belatreche, A and Li, Y

Improving Stock Price Prediction with SVM by Simple Transformation: The Sample of Stock Exchange of Thailand (SET)

Predicting Economic Recession using Data Mining Techniques

Real-time Analytics Methodology

Iran s Stock Market Prediction By Neural Networks and GA

Using artificial neural networks for forecasting per share earnings

A Novel Method of Trend Lines Generation Using Hough Transform Method

Research Article Hybrid Machine Learning Technique for Forecasting Dhaka Stock Market Timing Decisions

Module 12. Momentum Indicators & Oscillators

SYMBOL INFO INDICATOR

BUY SELL PRO. Improve Profitability & Reduce Risk with BUY SELL Pro. Ultimate BUY SELL Indicator for All Time Frames

AN ARTIFICIAL NEURAL NETWORK MODELING APPROACH TO PREDICT CRUDE OIL FUTURE. By Dr. PRASANT SARANGI Director (Research) ICSI-CCGRT, Navi Mumbai

Stock Market Basics Series

Keywords: artificial neural network, backpropagtion algorithm, capital asset pricing model

Estimating term structure of interest rates: neural network vs one factor parametric models

Maybank IB. Understanding technical analysis. by Lee Cheng Hooi. 24 September Slide 1 of Maybank-IB

International Journal of Advance Engineering and Research Development. Stock Market Prediction Using Neural Networks

Academic Research Review. Algorithmic Trading using Neural Networks

IVGraph Live Service Contents

TECHNICAL INDICATORS

Neuro Fuzzy based Stock Market Prediction System

Forecasting Price Movements using Technical Indicators: Investigating the Impact of. Varying Input Window Length

Applications of Neural Networks in Stock Market Prediction

ANN Robot Energy Modeling

Backpropagation and Recurrent Neural Networks in Financial Analysis of Multiple Stock Market Returns

Keywords Time series prediction, MSM30 prediction, Artificial Neural Networks, Single Layer Linear Counterpropagation network.

Evaluate the Ability of Artificial Neural Network to Predict the Stock Price of Non-Metallic Mineral Products Industry in Tehran's Stock Exchange

Development and Performance Evaluation of Three Novel Prediction Models for Mutual Fund NAV Prediction

Accepted Manuscript AIRMS: A RISK MANAGEMENT TOOL USING MACHINE LEARNING. Spyros K. Chandrinos, Georgios Sakkas, Nikos D. Lagaros

Chart-In-Chart Indicator. MetaTrader Master Edition

Studies in Computational Intelligence

META TRADER 5 MOBILE (iphone/ipad)

Stock Market Prediction with Various Technical Indicators Using Neural Network Techniques

A.K.Singh. Keywords Ariticial neural network, backpropogation, soft computing, forecasting

Barapatre Omprakash et.al; International Journal of Advance Research, Ideas and Innovations in Technology

Stock Market Prediction System

Predicting Abnormal Stock Returns with a. Nonparametric Nonlinear Method

Forexsignal30 Extreme ver. 2 Tutorials

Chapter 2.3. Technical Indicators

Ez Trading Platform. Alltogether, traders are able to perform a more comprehensive probability analysis of their trades.

COMPARING NEURAL NETWORK AND REGRESSION MODELS IN ASSET PRICING MODEL WITH HETEROGENEOUS BELIEFS

Stock Trading System Based on Formalized Technical Analysis and Ranking Technique

The Schaff Trend Cycle

Predicting Trading Signals of Stock Market Indices Using Neural Networks

Measuring abnormal returns on day trading - use of technical analysis. By Rui Ma

INTERMEDIATE EDUCATION GUIDE

A Comparative Study of Ensemble-based Forecasting Models for Stock Index Prediction

Bond Market Prediction using an Ensemble of Neural Networks

INDICATORS. The Insync Index

Intermediate - Trading Analysis

Stock Market Index Prediction Using Multilayer Perceptron and Long Short Term Memory Networks: A Case Study on BSE Sensex

T R A D E FX BASIC. 1. What is Forex? 2. 8 Majors. 3. What is bought and sold? 4. Types of Charts. 5. Basic Terms EBOOK 01.

Available online at ScienceDirect. Procedia Computer Science 61 (2015 ) 85 91

An Intelligent Forex Monitoring System

Stock price development forecasting using neural networks

ABSTRACT 1. INTRODUCTION

Figure (1 ) + (1 ) 2 + = 2

TECHNICAL ANALYSIS OF FUZZY METAGRAPH BASED DECISION SUPPORT SYSTEM FOR CAPITAL MARKET

The six technical indicators for timing entry and exit in a short term trading program

Abstract Making good predictions for stock prices is an important task for the financial industry. The way these predictions are carried out is often

Transcription:

Image Processing & Communication, vol. 17, no. 4, pp. 275-282 DOI: 10.2478/v10248-012-0056-5 275 PREDICTION OF CLOSING PRICES ON THE STOCK EXCHANGE WITH THE USE OF ARTIFICIAL NEURAL NETWORKS MICHAŁ PALUCH, LIDIA JACKOWSKA-STRUMIŁŁO Computer Engineering Department, Technical University of Lodz, Lodz, Poland mpaluch@kis.p.lodz.pl Abstract. Article describes, the use of Artificial Neural Networks (ANN) for predicting values of Stock Exchange shares. Rules of Stock Exchange functioning, principles of technical analysis and the most important stock market indices are described, which support investors, who plan to make transactions. ANN of Multi-Layer Perceptron (MLP) type, and a moving window method are applied. A hybrid method is also proposed, in which time series of CLOSE values as a function of the following trading days are used to stock market indices calculation, such as moving averages and oscillators, which are applied to ANN inputs. Research was conducted for 80 companies, selected from the 1218 companies functioning on Stock Exchange. The achieved maximum error in one day ahead CLOSE value prediction is 1,31%. 1 Introduction Nowadays, when economics is supported by IT (Information Technology) the modern trading systems can meet the most demanding customer needs. With the increase of trading systems complexity there is also a growing interest in combining them with artificial neural networks [2, 4, 7, 10, 11], with an objective of maximizing profits. The financial market, which uses the most advanced IT solutions, provides a variety of products to meet this goal. From all of them, the most popular are financial instruments offered by the Stock Exchange, which may be the most profitable but there is also a risk of losing all assets [3]. This is why the Stock Exchange as a nonlinear dynamic system [10] is a challenge for the developed modelling schemes in which artificial neural network (ANN) are gaining in importance. The relation between risk and profit is presented in Fig. 1. Examples of possible use of ANN on the Stock Exchange are prediction of future stock market indices [2, 7, 10], exchange rates [11], share prices, etc. The most commonly used artificial neural networks to predict the trading signals are the feedforward neural networks (FNN) [4, 7, 11] and probabilistic neural networks (PNN) [10], but also new approaches and ANN structures, like for e.g. State Space Wavelet Network (SSWN) [2] are still the subject of scientific studies. However, analyzing the market state and examples from literature [3, 4], it was found that it is risky to make investment decisions based solely on ANN prediction and

276 M. Paluch, L. Jackowska-Strumiłło Fig. 1: Relation between profit and risk in the most popular financial instruments [14] without the use of risk models. Analysis of the market situation should be approached on many levels. Technical analysis provides many tools that can accomplish this goal. Therefore, in this work a hybrid approach combining technical analysis and ANN is proposed. 2 The functioning of the stock exchange and an introduction to technical analysis Stock Exchange is a place where buyers and sellers exchange the goods after establishing jointly accepted price. Trading is immaterial meaning that all securities are stored in the form of electronic records in the system of National Depository for Securities and on customers investment accounts in brokerage houses. Each order of buying and selling must contain specific information such as the name of the security, type of order, the date, value, number, etc. Stock Exchange is a place in which, within a short time, much can be gained and much can be lost. Still, it is difficult to talk about long-term income without having a strategy. In this aspect, investors can be divided into two groups [12]: long-term investors, who, on the basis of a detailed fundamental analysis of companies, buy a large amount of shares and sell after a few months or sometimes even years, short-term investors, who, in order to minimize the risk, close the positions every day, and their investment decisions are based on technical analysis. Fundamental analysis means detailed immersion in the activity of the company in which one is going to invest, its sector and related sectors. Technical analysis is a type of market research, mainly with the help of charts and indicators. The study is based on three premises [12]: The market discounts everything. Prices are subject to trends. History repeats itself. According to the above principles, technical analysis can serve as a starting point for creating a transaction system, which, on the basis of the decisions of an artificial neural network, provides the user with a set of companies that achieve the highest profit and the highest loss. As a consequence, the user obtains information on when and which securities should be sold or bought. 3 Application of ANN for prediction of closing prices Closing price of the asset for the next day is the most important parameter for investors, who plan to make trans-

Image Processing & Communication, vol. 17, no. 4, pp. 275-282 277 actions at the Stock Exchange. In this work a hybrid approach combining technical analysis and ANN is proposed, which can support them in making correct decisions. The main idea of the proposed method is shown in Fig. 2. Technical analysis methods are used to calculate moving averages and oscillators, which are important market indicators. These are the inputs of ANN, which predicts the CLOSE value for the next day. The aim of this work was to investigate, if the proposed data preprocessing and market indicators calculation would improve the ANN effectiveness in the CLOSE value prediction. Feedforward networks of Multi-Layer Perceptron (MLP) type trained with the backpropagation algorithm [8] were used for the CLOSE value prediction. For the comparison purposes the CLOSE value signal was predicted by the use of MLP and so called moving window method [6], in which the network is exposed to current and a number of past samples of the signal. For research purposes, quotations of 1218 companies appearing on the stock market were downloaded and limited to the data since 3.01.2000 until 27.01.2012. The programming application was designed and implemented for the data collecting and preprocessing. The calculated moving averages and oscillators were used for neural network training and testing. Finally, the results obtained with the hybrid and with the purely ANN-based approach were compared. 4 Averages and indicators used for networks training Technical analysis provides many tools that support investors in making decisions. The most commonly used are moving averages and oscillators, which were selected for the proposed approach [5]. These include the following: Moving averages: a. Arithmetical (5-, 10-, 20-days) - SMA (Simple Moving Average) SMA N (k) = 1 [C(k) + C(k 1) +... N +C(k N + 1)] (1) where: N - number of days, N = 5, 10, 20 C(k) - closing price in the k-th day b. Weighted (5-, 10-, 20-days) - LW M A (Linearly Weighted Moving Average) LW MA N,C (k) = + NC(k) + (N 1)C(k 1) +... N + (N 1) +... + 1 C(k N + 1) N + (N 1) +... + 1 c. Expotential (5-, 10-, 20-days) - EMA (Expotential Moving Average) EMA N,C (k) = C(k) + ac(k 1) + a2 C(k 2) +... 1 + a + a 2 +... + a N 1 + where: a - coefficient, (2) a N 1 C(k N + 1) 1 + a + a 2 +... + a N 1 (3) d. Envelopes (3% error with 20-days average) e. Bollinger Bands These tools are used to study the already existing trend. Their task is to signal the launch of a new trend or a reversal of the current trend. They follow the trend and not precede it, so they do not predict market behavior. They are used primarily to mitigate deviations of prices. Additionally, the Bollinger band and envelopes are used to determine when the market is overbought.

278 M. Paluch, L. Jackowska-Strumiłło Fig. 2: Processing scheme for predicting course of a CLOSE value for the next day Oscillators a. ROC - Rate of Change (5-, 10-, 20-days) - determines the rate of price changes in a given period (usually 10 days) ROC N (k) = C(k)/C(k N) (4) b. - Relative Strength Index - i.e. the measure of overbought / oversold market. It assumes values in the range of 0-100. For values greater than 70 it is considered that the market is buyout. When oscillator values are below 30, it means that market is sold out. In the case of periods of strong trends it is assumed that the market is buyout when > 80 (at the time of a bull market) and sold out for < 20 (during a bear market). For: C(k) > C(k 1), U(k) = C(k) C(k 1) C(k) < C(k 1), D(k) = C(k) C(k 1) (k) = 100 100 (5) 1 + EMA N,U (k) EMA N,D (k) where U(k) - average increase in the k-th day, D(k) - average decrease in the k-th day c. Stochastic oscillator (K%D) - determines the relation between the last closing price and the range of price fluctuations in the given period. The result belongs to the range of 0-100. K%D > 70 is interpreted as the closing price near the top of the range of its fluctuations, and K%D < 30 points to the fact that prices are shaping near the lower limit of that range. %K = 100[C(k) L(14)/(H(14) L(14))] (6) where: L(14) - the lowest price from last fourteen days, H(14) - the highest price from last fourteen days d. Moving Average Convergence/Divergence (M ACD) is the difference between two moving averages. On the graphs, it usually occurs with 10- day, exponential moving average (called the signal line). The intersection of the signal line (SL) with the MACD line coming from the bottom is a buying signal, while with the line from the top selling signal. MACD(k) = EMA 12,C (k) EMA 26,C (k) (7) SL(k) = EMA 9,MACD (k) (8) 5 Experimental research Research was conducted for 80 companies appearing on the stock market in Warsaw since 3.01.2000 until now, selected from the all 1218 companies functioning on stock market since 1991. The aim of the research was to test different ANN architectures and to choose the best one for predicting the CLOSE value of the asset for the next day. The research was performed with the use of Java and Neuroph 2.6. library, creating ANN of Multi-Layer Perceptron (MLP) type. Each network consists of an input,

Image Processing & Communication, vol. 17, no. 4, pp. 275-282 279 Tab. 1: Combinations of the tested MLP architectures Input layer Hidden layer Output n + 1 n 1, 5n 1 2n 1 2n + 1 where n - number of neurons (n = 4, 5, 6 neurons) hidden and output layer. A common feature of all of the tested network architectures is a small number of the input nodes and neurons in the hidden layer, and only one neuron in the output layer. Too many neurons would increase the network training error and could cause learning time extension [4]. The relations between the number of input nodes and the number of neurons in the hidden layer were tested for the combinations shown in Tab. 1. Market indicators for the input data were selected as described in literature [1, 4, 5, 13] or randomly. ANN training was performed according to the following rules: 1. All entered data were normalized using the following formula: (V alue/v aluemax) 0, 8 + 0, 1 (9) 2. The results of each company were divided into two groups: learning data and testing data in the proportion 80:20 [9]. 3. Weights for each input were set randomly. 4. Neural networks were taught with the back propagation algorithm with momentum factor [7, 8]. 5. For each ANN architecture and each set of input data, eight neural networks were trained, and the ANN with the smallest error has been selected as the best one. As a result of these studies six best ANN architectures with the smallest training and testing errors have been selected. The results for these ANN architectures obtained for one exemplary company Asseco Poland SA are presented in Tab. 2. An example of MLP (5-9-1) structure, which is listed in position 1 is shown in Fig. 3. Fig. 3: An example of Multi-Layer Perceptron MLP (5-9- 1) - position 1 in Tab. 2 The neural network of MLP (5-9-1) structure shown in Fig. 3 is composed of an input layer which consists of five input nodes and a hidden layer with nine neurons. The result is derived in a single output. The above architecture represents one of the tested relations between the number of neurons in the input layer and their number in the hidden layer. The results of short-term forecast of CLOSE value of Asseco Poland SA shares in August 2011 predicted with the use of MLP (5-9-1) network are presented in Fig. 4 and in Tab. 3. 6 Summary and conclusions The presented studies on application of neural networks for predicting the closing prices on the stock exchange have shown that the relatively low rates of errors were achieved (less than 1,5%). Hence, the studied neural

280 M. Paluch, L. Jackowska-Strumiłło Tab. 2: Architectures of the selected networks, which achieved the best results No. Input MLP Transfer Periods Training Testing function error error (MSE) (MSE) SMA 10 SMA 20 1. Bollinger Band 5-9-1 sigmoidal 1000 0,026 0,0017 MACD SMA 10 2. MACD 4-5-1 sigmoidal 4000 0,031 0,0024 Bollinger Band LWMA 5 3. LWMA 20 4-7-1 sigmoidal 1000 0,027 0,0021 Envelope EMA 5 EMA 10 4. Bollinger Band 6-9-1 sigmoidal 4000 0,034 0,0028 ROC MACD EMA 5 EMA 20 5. Envelope 6-9-1 sigmoidal 700 0,032 0,0023 K%D MACD CLOSE values 6. from last 5-6-1 sigmoidal 2500ă 0,0018 0,0011ă five days

Image Processing & Communication, vol. 17, no. 4, pp. 275-282 281 Fig. 4: Short-term forecast of MLP (5-9-1) network, with real CLOSE value of Asseco Poland SA shares in August 2011 network based model can be used to make good investtab. 3: Comparison of real quotes and network forecast for Asseco Poland SA Data CLOSE CLOSE Relative real network error in quotes forecast prediction [PLN] [PLN] [%] 1-08-2011 47,67 47,21 0,97 2-08-2011 47,8 47,28 1,08 3-08-2011 46,9 46,45 0,97 4-08-2011 45,17 44,71 1,02 5-08-2011 43,85 43,46 0,88 8-08-2011 40,95 40,67 0,68 9-08-2011 39,81 39,73 0,19 10-08-2011 37,5 37,82 0,84 11-08-2011 37,15 37,51 0,98 12-08-2011 39,47 39,45 0,06 16-08-2011 39,88 39,78 0,26 17-08-2011 39,38 39,36 0,05 18-08-2011 36,99 37,37 1,04 19-08-2011 36,39 36,87 1,31 22-08-2011 37,25 37,6 0,93 23-08-2011 37,2 37,55 0,93 24-08-2011 36,9 37,29 1,06 25-08-2011 38,74 38,84 0,25 26-08-2011 38,21 38,28 0,19 29-08-2011 39,45 39,19 0,66 30-08-2011 39,8 39,45 0,87 31-08-2011 42,5 42,23 0,63 ment decisions and reduce the risk of loss. The results presented in Tab. 2, allow to conclude that for all studied networks, the best results were obtained by the network architecture no. 6 in Tab. 2, for which, in the input, CLOSE values for last five days were forwarded. In this approach, the ANN was able to predict with the low error rate, CLOSE value for next day. Nevertheless this approach has disadvantages. ANN is exposed to receive false signals from the market, which may ultimately lead to increase network errors. This explains the differences between the current and predicted by the network, CLOSE values in a number of periods. Taking this into consideration, the safer solution would be to use a neural network architecture no. 1 in Tab. 2. This network features a larger error, but is not so vulnerable to false signals from the market because economic models are incorporated into the proposed hybrid modeling scheme. However, because the Stock Exchange market, often occurs uncontrollable, there is a need to protect investments by additional mechanisms and risk models, mitigating the impact of similar situations on the "investor s wallet." Still, regardless of the number of the developed neural networks and economic models, it should be the

282 M. Paluch, L. Jackowska-Strumiłło stock broker who makes the final decision to purchase or sell securities. References [1] R. Bensignor, New Concepts in Technical Analysis, Wig-Press, (in Polish) Warsaw 2004 [2] M.A. Brdyś, A. Borowa, P. Idźkowiak, M.T. Brdyś, Adaptive Prediction of Stock Exchange Indices by State Space Wavelet Networks, Int. J. Appl. Math. Comput. Sci., Vol. 19, No. 2, pp. 337-348, 2009 [3] W. Dębski, Financial Market and it mechanisms, (in Polish), PWN, Warsaw 2010 Signals Using Neural Networks, In Proc. of the 14th Annual Global Finance Conference (GFC 2007), Melbourne, Australia, pp. 171-179, Sep. 2007 [11] D. Witkowska, Artificial Neural Networks and statistical methods, Selected financial issues, (in Polish), C. H. Beck, Warsaw 2002 [12] A. Zaremba, Stock Exachange, (in Polish), 2010 [13] J. Zieliński, Intelligent management systems - theory and practice, (in Polish), Warsaw 2000 [14] http://www.mbank.pl/inwestycje/centruminwestora/fundusze/narzedzia/ryzykoinwestycyjne.html [4] Ed. Gately, Neural Networks - Financial forecasting and transactional systems design, (in Polish), Wig- Press, Warsaw 1999 [5] J.J. Murphy, Technical Analysis of Financial Markets, (in Polish), Wig-Press, Warsaw, 2008 [6] K.S. Narendra, K. Parthasarathy, Identification and control of dynamics systems using neural networks, IEEE Transactions on Neural Networks, Vol. 1, No. 1, pp. 4-27, 1990 [7] P. Sutheebanjard, W. Premchaiswadi, Stock Exchange of Thailand Index Prediction Using Back Propagation Neural Networks, In Proc. of the Second International Conference on Computer and Network Technology (ICCNT), Bangkok, pp. 377-380, 2010 [8] R. Tadeusiewicz, Artificial Neural Networks, (in Polish), Warsaw 1993 [9] R. Tadeusiewicz, Discovering Neural Networks, (in Polish), Cracow 2007 [10] C.D. Tilakaratne, S.A. Morris, M.A. Mammadov, C.P. Hurst, Predicting Stock Market Index Trading