Hybrid Models Combining Technical and Fractal Analysis with ANN for Short-Term Prediction of Close Values on the Warsaw Stock Exchange
Abstract
:1. Introduction
2. Technical Analysis Indicators
- Moving averages:
- The simple moving average (SMA) for 5, 10, or 20 days:
- The exponential moving average (EMA) for 5, 10, or 20 days:
- Oscillators
- The rate of change (ROC) characterizes the rate of price changes over 5, 10, or 20 days:
- The relative strength index (RSI) is used to identify whether the market is overbought or oversold. The values are always in the range from 0 to 100. If the RSI is smaller than 30, it is assumed that the market is sold out, while a value larger than 70 means that the market is bought out. However, in the case of strong trends, RSI < 20 signifies a sold-out market (during a bear market) and RSI > 80 indicates a buyout market (during a bull market). The RSI is a measure of the strength of growth movements in relation to downward movements.U(k)—average increase on the k-th day, and for C(k) > C(k − 1), U(k) = C(k) − C(k − 1),D(k)—average decrease on the k-th day, and for C(k) < C(k − 1), D(k) = |C(k) − C(k − 1),EMAN,U, EMAN,D—exponential moving averages for N days and for U(k) or D(k), respectively.
- The stochastic oscillator (K%D) determines the relative value of the last closing price in relation to the considered range of price changes in a given period. Oscillator values cover a range from 0 to 100. If K%D is over 70, that the closing price is considered to be near the top end of the range of its fluctuations. A K%D below 30 indicates that it is close to the lower end of that range.
- The moving average convergence/divergence (MACD) is defined as the difference between the long-term and short-term values of exponential moving averages. This oscillator is used to study buy and sell signals. It is usually compared with its 9-day exponential moving average, which is called the signal line (SL). The intersection of these two signals indicates a buying signal if the MACD line comes from the bottom, and a selling signal if this line is from the top.MACD(k) = EMA12, C (k) − EMA26,C(k)SL(k) = EMA9(MACD(k))
- Accumulation/distribution (AD) relates to the price and volume and indicates whether the price changes in the stock market appear together with increased accumulation and distribution movements.
- The Bollinger oscillator (BOS) informs whether the market is overbought or oversold. It is derived from the Bollinger bands.
3. Fractal Analysis
- The relative strength index with FRAMA (RSI_FRAMA)—this FA indicator is derived from the TA indicator RSI (Equation (4)) by replacing EMA with FRAMA.
- The moving average convergence/divergence with FRAMA (MACD_FRAMA)—this FA oscillator is based on MACD (Equation (6)) and SL (Equation (7)), as described in Section 3.MACD_FRAMAC(k) = FRAMA12,C(k) − FRAMA26,C(k),SLF(k) = FRAMA9,MACD_FRAMA(k),
- The Bollinger oscillator with FRAMA (BOS_FRAMA) is based on Bollinger bands. It is derived from the BOS given in Equation (9) by replacing SMA by FRAMA. This oscillator indicates when the market is overbought or oversold.
4. Application of Hybrid Analytical—Neural Models for Share Price Forecasting
- Hybrid models combining technical analysis and ANN (TA–ANN)
- Hybrid models combining fractal analysis and ANN (FA–ANN)
- Hybrid models combining technical and fractal analyses and ANN (TA–FA–ANN)
5. Experimental Part
5.1. Methodology
- A set of ANN input data vectors (i.e., not repeated combinations of market indicators with or without CLOSE past samples for a selected company) is generated randomly.
- For each combination of input data, a set of MLP structures is generated and for n inputs, the number of neurons in the hidden layer is changed as follows: n + 1, 1.5n, 2n − 1, 2n + 1, 3n, where n = 4, 5, 6, 7, 8, 9, ...
- For each input vector and each MLP structure:
- All input data are normalized to <0.1; 0.9> range using the following formula:Normalized_Value = 0.8 (Value/Valuemax) + 0.1;
- The training data for each company are divided into a learning data set and a testing data set, where the testing set is about 30%;
- The ANNs are trained using the resilient propagation algorithm with a momentum factor;
- Eight different ANNs are trained and the ANN with the smallest MSE for the testing data is chosen as the best.
- From the whole set of trained ANNs, a small subset of the best ANNs is identified, for which the MSE for the testing data is smaller than the defined error limit.
- First, 12,628 various input data vectors were generated randomly for one company. Then, 208,518 different MLPs were trained. Each network was trained according to the rules defined above.
- In the second step, 29,149 MLPs with the smallest MSE were selected and their structures used to train ANNs for three randomly chosen companies.
- Next, 5545 ANN structures with an MSE smaller than the defined error limit were used to train ANNs for all five companies.
- Finally, 300 ANNs with the lowest MSE for the testing data for all five companies were selected and used to predict close values for the next day.
5.2. Results
- The highest prediction error per month Emax—i.e., the highest difference between the real CLOSE value and the value predicted by the ANN per month:
- Arithmetical mean of the month Emax values per tested period of time (one year):
6. Discussion and Conclusions
Author Contributions
Funding
Conflicts of Interest
References
- Malkiel, B.G. A Random Walk Down Wall Street, 6th ed.; W.W. Norton & Company, Inc.: New York, NY, USA, 1973. [Google Scholar]
- Fama, E. Efficient Capital Markets: A Review of Theory and Empirical Work. J. Financ. 1970, 25, 383–417. [Google Scholar] [CrossRef]
- Jegadeesh, N.; Titman, S. Profitability of Momentum Strategies: An evaluation of alternative explanations. J. Financ. 2001, 56, 699–720. [Google Scholar] [CrossRef]
- Lo, A.W.; Mackinlay, A.C. A Non-Random Walk Down Wall Street, 5th ed.; Princeton University Press: Princeton, NJ, USA, 2002; pp. 4–47. [Google Scholar]
- Granger, C.W.J.; Morgenstern, O. Spectral Analysis of New York Stock Market Prices. Kyklos 2007, 16, 1–27. [Google Scholar] [CrossRef]
- Guido, R.C.; Barbon, S., Jr.; Vieira, L.S.; Sanchez, F.L.; Maciel, C.D.; Pereira, J.C.; Scalassara, P.R.; Fonseca, E.S. Introduction to the discrete shapelet transform and a new paradigm: Joint time-frequency-shape analysis. In Proceedings of the IEEE International Symposium on Circuits and Systems (IEEE ISCAS 2008), Seattle, WA, USA, 18–21 May 2008; Volume 1, pp. 2893–2896. [Google Scholar]
- Witkowska, D. Artificial Neural Networks and Statistical Methods. Selected Financial Issues; C. H. Beck: Warsaw, Poland, 2002. [Google Scholar]
- Box, G.E.P.; Jenkins, G.M. Time Series Analysis. Forecasting and Control; Holden-Day Inc.: San Francisco, CA, USA, 1976. [Google Scholar]
- Dębski, W. Financial Market and It Mechanisms; PWN: Warsaw, Poland, 2010. (In Polish) [Google Scholar]
- Sutheebanjard, P.; Premchaiswadi, W. Stock Exchange of Thailand Index Prediction Using Back Propagation Neural Networks. In Proceedings of the Second International Conference on Computer and Network Technology (ICCNT), Bangkok, Thailand, 23–25 April 2010; pp. 377–380. [Google Scholar] [CrossRef]
- Tilakaratne, C.D.; Morris, S.A.; Mammadov, M.A.; Hurst, C.P. Predicting Stock Market Index Trading Signals Using Neural Networks. In Proceedings of the 14th Annual Global Finance Conference (GFC 2007), Melbourne, Australia, September 2007; pp. 171–179. [Google Scholar]
- Zhou, X.S.; Dong, M. Can fuzzy logic make technical analysis 20/20? Financ. Anal. J. 2004, 60, 54–75. [Google Scholar] [CrossRef]
- Hornik, K.; Stinchcombe, M.; White, H. Multilayer Feedforward Networks are Universal Approximators. Neural Netw. 1990, 3, 551–560. [Google Scholar] [CrossRef]
- Gately, E. Neural Networks for Financial Forecasting; Wiley: New York, NY, USA, 1995. [Google Scholar]
- Hamzacebi, C.; Akay, D.; Kutay, F. Comparison of direct and iterative artificial neural network forecast approaches in multi-periodic time series forecasting. Expert Syst. Appl. 2009, 36, 3839–3844. [Google Scholar] [CrossRef]
- Zieliński, J. Intelligent Management Systems—Theory and Practice; PWN: Warsaw, Poland, 2000. (In Polish) [Google Scholar]
- Ghiassi, M.; Saidane, H.; Zimbra, D.K. Dynamic artificial neural network model for forecasting time series events. Int. J. Forecast. 2005, 21, 341–362. [Google Scholar] [CrossRef]
- Majhi, R.; Panda, G.; Sahoo, G. Efficient prediction of exchange rates with low complexity artificial neural network models. Expert Syst. Appl. 2009, 36, 181–189. [Google Scholar] [CrossRef]
- Brdyś, M.A.; Borowa, A.; Idźkowiak, P.; Brdyś, M.T. Adaptive Prediction of Stock Exchange Indices by State Space Wavelet Networks. Int. J. Appl. Math. Comput. Sci. 2009, 19, 337–348. [Google Scholar] [CrossRef] [Green Version]
- Hajto, P. A Neural Economic Time Series Prediction with the Use of a Wavelet Analysis. Schedae Inform. 2002, 11, 115–132. [Google Scholar]
- Tadeusiewicz, R. Discovering Neural Networks Using Programs in C# Programming Language; Polska Akademia Umiejętności: Cracow, Poland, 2007. (In Polish) [Google Scholar]
- Paluch, M.; Jackowska-Strumiłło, L. Prediction of closing prices on the Stock Exchange with the use of artificial neural networks. Image Process. Commun. 2012, 17, 275–282. [Google Scholar] [CrossRef]
- Zhang, G.P. Time series forecasting using a hybrid ARIMA and neural network model. Neurocomputing 2003, 50, 159–175. [Google Scholar] [CrossRef]
- Khashei, M.; Bijari, M. An artificial neural network (p, d, q) model for time series forecasting. Expert Syst. Appl. 2010, 37, 479–489. [Google Scholar] [CrossRef]
- Güresen, E.; Kayakutlu, G. Forecasting Stock Exchange Movements Using Artificial Neural Network Models and Hybrid Models. In Intelligent Information Processing IV, Proceedings of the IFIP International Federation for Information Processing, Beijing, China, 19–22 October 2008; Shi, Z., Mercier-Laurent, E., Leake, D., Eds.; Springer: Boston, MA, USA, 2008; Volume 288, pp. 129–137. [Google Scholar]
- Güresen, E.; Kayakutlu, G.; Daim, T.U. Using artificial neural network models in stock market index prediction. Expert Syst. Appl. 2011, 38, 10389–10397. [Google Scholar] [CrossRef]
- Witkowska, D.; Marcinkiewicz, E. Construction and Evaluation of Trading Systems: Warsaw Index Futures. Int. Adv. Econ. Res. 2005, 11, 83–92. [Google Scholar] [CrossRef]
- Faustryjak, D.; Majchrowicz, M.; Jackowska-Strumiłło, L. Web System Supporting Stock Prices Analysis. In Proceedings of the International Interdisciplinary PhD Workshop 2017 (IIPhDW 2017), Lodz, Poland, 9–11 September 2017; pp. 157–163, ISBN 978-83-7283-858-2. [Google Scholar]
- Faustryjak, D.; Jackowska-Strumiłło, L.; Majchrowicz, M. Forward Forecast of Stock Prices Using LSTM Neural Networks with Statistical Analysis of Published Messages. In Proceedings of the International Interdisciplinary PhD Workshop 2018 (IIPhDW 2018), Świnoujście, Poland, 9–12 May 2018; pp. 288–292. [Google Scholar] [CrossRef]
- Paluch, M.; Jackowska-Strumiłło, L. The influence of using fractal analysis in hybrid MLP model for short-term forecast of close prices on Warsaw Stock Exchange. In Proceedings of the Federated Conference on Computer Science and Information Systems 2014, FedCSIS 2014, Warsaw, Poland, 7–10 September 2014; pp. 111–118. [Google Scholar] [CrossRef]
- Jackowska-Strumiłło, L. Hybrid Analytical and ANN-based Modelling of Temperature Sensors Nonlinear Dynamic Properties. In Lecture Notes in Artificial Intelligence, Proceedings of the 6th International Conference on Hybrid Artificial Intelligence Systems, HAIS 2011, Wroclaw, Poland, 23–25 May 2011; LNAI 6678; Springer: Berlin, Germany, 2011; Part I; pp. 356–363. [Google Scholar] [CrossRef]
- Jackowska-Strumillo, L.; Cyniak, D.; Czekalski, J.; Jackowski, T. Neural model of the spinning process dedicated to predicting properties of cotton-polyester blended yarns on the basis of the characteristics of feeding streams. Fibres Text. East. Eur. 2008, 16, 28–36. [Google Scholar]
- Paluch, M.; Jackowska-Strumiłło, L. Intelligent information system for stock exchange data processing and presentation. In Proceedings of the 8th International Conference on Human System Interaction (HSI 2015), Warszawa, Poland, 25–27 June 2015; pp. 238–243. [Google Scholar] [CrossRef]
- Paluch, M.; Jackowska-Strumiłło, L. Decision system for stock data forecasting based on Hopfield artificial neural network. Inform. Control Measure. Econ. Environ. Protect. 2016, 6, 28–33. [Google Scholar] [CrossRef]
- Paluch, M.; Jackowska-Strumiłło, L. Intelligent Decision System for Stock Exchange Data Processing and Presentation. In Human-Computer Systems Interaction. Backgrounds and Applications 4; Series: Advances in Intelligent Systems and Computing; Hippe, Z.S., Kulikowski, J.L., Mroczek, T., Eds.; Springer International Publishing AG: Cham, Switzerland, 2018; Volume 551, pp. 80–90. [Google Scholar] [CrossRef]
- Drabik, E. Applications of Game Theory to Invest in Securities; Wydawnictwo Uniwersytetu w Białymstoku: Białystok, Poland, 2000. (In Polish) [Google Scholar]
- Ehlers, J. Fractal Adaptive Moving Average; Technical Analysis of Stock & Commodities: Seattle, WA, USA, 2005. [Google Scholar]
- Guariglia, E. Entropy and Fractal Antennas. Entropy 2016, 18, 84. [Google Scholar] [CrossRef]
- Guariglia, E. Harmonic Sierpinski Gasket and Applications. Entropy 2018, 20, 714. [Google Scholar] [CrossRef]
- Berry, M.V.; Lewis, Z.V. On the Weierstrass-Mandelbrot fractal function. Proc. R. Soc. Lond. Ser. A 1980, 370, 459–484. [Google Scholar] [CrossRef]
- Murphy, J.J. Technical Analysis of Financial Markets; Wig-Press: Warsaw, Poland, 2008. (In Polish) [Google Scholar]
- Ehlers, J. Cybernetics Analysis for Stocks and Futures; John Wiley & Sons: New York, NY, USA, 2004. [Google Scholar]
- Rutkowski, L. Methods and Techniques of Artificial Intelligence; PWN: Warsaw, Poland, 2009. (In Polish) [Google Scholar]
- Tadeusiewicz, R. Artificial Neural Networks; Akademicka Oficyna Wydawnicza RM: Warsaw, Poland, 1993. (In Polish) [Google Scholar]
- Garcia, M.A.; Trinh, T. Detecting Simulated Attacks in Computer Networks Using Resilient Propagation Artificial Neural Networks. Polibits 2015, 51, 5–10. [Google Scholar] [CrossRef] [Green Version]
- Bensignor, R. New Concepts in Technical Analysis; Wig-Press: Warsaw, Poland, 2004. (In Polish) [Google Scholar]
- Bulkowski, T.N. Formation Analysis on Stock Charts; Linia: Warsaw, Poland, 2011. (In Polish) [Google Scholar]
- Narendra, K.S.; Parthasarathy, K. Identification and control of dynamics systems using neural networks. IEEE Trans. Neural Netw. 1990, 1, 4–27. [Google Scholar] [CrossRef] [PubMed]
Company | Model Structure | Type of ANN-Based Model | |||
---|---|---|---|---|---|
FA–ANN | TA–ANN | FA–TA–ANN | ANN | ||
ŻYWIEC | ANN structure | MLP(6–12–1) | MLP(22–33–1) | MLP(8–12–1) | MLP(8–17–1) |
Transfer function | sigmoidal | sigmoidal | Sigmoidal | Sigmoidal | |
MSE | 0.00013 | 0.00077 | 0.00041 | 0.00206 | |
ANN inputs | FRAMA10,C(k) FRAMA16,C(k) C(k − 1) … C(k − 4) | MACD(k) SMA5,C(k) LWMA5,C(k) LWMA10,C(k) LWMA20,C(k) TMA10,C(k) HULL20,C(k) HULL25,C(k) HULL30,C(k) RSI9,C(k) Williams_Indicator(k) CCI(k) Momentum20,C(k) ROC(k) EMA20,ROC(k) C(k − 1) … C(k − 7) | FRAMA10,C(k) FRAMA16,C(k) Volume Oscillator(k) SL9,MACD(k) FRAMA9,HL(k) LWMA10,C(k) LWMA20,C(k) ChaikinOscillator_FRAMA(k) | C(k − 1) … C(k − 8) | |
ASSECO POLAND | ANN structure | MLP(7–13–1) | MLP(13–27–1) | MLP(6–7–1) | MLP(9–13–1) |
Transfer function | sigmoidal | sigmoidal | Sigmoidal | Sigmoidal | |
MSE | 0.00003 | 0.0001 | 0.00003 | 0.00089 | |
ANN inputs | FRAMA10,C(k) FRAMA16,C(k) C(k − 1) … C(k − 5) | EMA5,C(k) EMA30,C(k) Ultimate_Oscillator CHL3 RSI9,C(k) HULL_RSI14,C(k) C(k − 1) … C(k − 7) | qStick_FRAMA SMA20,C(k) LWMA20,C(k) TMA5,C(k) TMA10,C(k) ROC(k) | C(k − 1) … C(k − 9) | |
BANK BPH | ANN structure | MLP(8–12–1) | MLP(13–27–1) | MLP(6–7–1) | MLP(25–51–1) |
Transfer function | sigmoidal | Hyperbolic tangent | Sigmoidal | Hyperbolic tangent | |
MSE | 0.00001 | 0.00007 | 0.00002 | 0.00045 | |
ANN inputs | FRAMA20,C(k) MACD_FRAMA(k) FRAMA9,HL(k) CCI_FRAMA(k) C(k − 1) … C(k − 4) | SMA10,C(k) LWMA20,C(k) Momentum20,C(k) Std_Dev_HuLL10,C(k) C(k − 1) … C(k − 9) | FRAMA10,C(k) FRAMA16,C(k) Detrend Price Oscillator5,C(k) Detrend Price Oscillator10,C(k) Detrend Price Oscillator20,C(k) Mass_Index25,C(k) | C(k − 1) … C(k − 25) | |
BUDIMEX | ANN structure | MLP(13–25–1) | MLP(15–22–1) | MLP(13–25–1) | MLP(14–15–1) |
Transfer function | sigmoidal | sigmoidal | Sigmoidal | Sigmoidal | |
MSE | 0.00175 | 0.00288 | 0.00165 | 0.00986 | |
ANN inputs | FRAMA10,C(k) FRAMA16,C(k) BOS_FRAMA20,C(k) Chaikin Volatility_FRAMA(k) C(k − 1) … C(k − 9) | EMA5,C(k) EMA10,C(k) HULL_RSI9,C(k) Detrend Price Oscillator5,C(k) Mass_Index25,C(k) Profitability Index Rule14,C(k) C(k − 1) … C(k − 9) | FRAMA16,C(k) EMA5,C(k) EMA10,C(k) EMA30,C(k) FRAMA20,C(k) SL9,MACD(k) MACD_FRAMA(k) Fractal Dimension5,C(k) Fractal Dimension16,C(k) SMA20,C(k) HULL25,C(k) FRAMA5,C(k) CCI_FRAMA(k) | C(k − 1) … C(k − 14) | |
VISTULA | ANN structure | MLP(10–15–1) | MLP(13–27–1) | MLP(13–14–1) | MLP(15–22–1) |
Transfer function | sigmoidal | sigmoidal | Sigmoidal | Sigmoidal | |
MSE | 0.00003 | 0.00013 | 0.00004 | 0.00056 | |
ANN inputs | FRAMA10,C(k) FRAMA16,C(k) AverageTrueRange_FRAMA(k) Chaikin Volatility_FRAMA(k) C(k − 1) … C(k − 6) | EMA25,C(k) SL9,MACD(k) LWMA10,C(k) HULL30,C(k) CCI(k) ROC(k) Volume_ROC(k) Freedom of Movement Indicator(k) EMA20,ROC(k) C(k − 1) … C(k − 4) | FRAMA16,C(k) EMA10,C(k) EMA30,C(k) CHL(k), MACD_FRAMA(k) LWMA5,C(k) EMA9,HL(k) TMA5,C(k) HULL30,C(k) Stochastic Oscillator_W3,C(k) ROC(k) Volume_ROC(k) Chaikin Oscillator_FRAMA(k) | C(k − 1) … C(k − 15) |
Company | FA–ANN | TA–ANN | TA–FA–ANN | ANN | ||||
---|---|---|---|---|---|---|---|---|
(PLN) | (%) | (PLN) | (%) | (PLN) | (%) | (PLN) | (%) | |
BPH BANK | 4.73 | 7.35 | 6.63 | 10.8 | 9.47 | 14.85 | 40.92 | 74.37 |
ŻYWIEC | 5.61 | 1.09 | 11.95 | 2.34 | 13.11 | 2.58 | 15.68 | 3.13 |
VISTULA | 0.10 | 3.88 | 0.13 | 5.35 | 0.12 | 4.85 | 0.61 | 24.56 |
BUDIMEX | 2.65 | 2.89 | 3.93 | 4.39 | 1.4 | 1.58 | 7.57 | 8.24 |
ASSECOPOL | 0.81 | 1.46 | 1.87 | 3.33 | 0.98 | 1.73 | 5.16 | 9.32 |
© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Paluch, M.; Jackowska-Strumiłło, L. Hybrid Models Combining Technical and Fractal Analysis with ANN for Short-Term Prediction of Close Values on the Warsaw Stock Exchange. Appl. Sci. 2018, 8, 2473. https://doi.org/10.3390/app8122473
Paluch M, Jackowska-Strumiłło L. Hybrid Models Combining Technical and Fractal Analysis with ANN for Short-Term Prediction of Close Values on the Warsaw Stock Exchange. Applied Sciences. 2018; 8(12):2473. https://doi.org/10.3390/app8122473
Chicago/Turabian StylePaluch, Michał, and Lidia Jackowska-Strumiłło. 2018. "Hybrid Models Combining Technical and Fractal Analysis with ANN for Short-Term Prediction of Close Values on the Warsaw Stock Exchange" Applied Sciences 8, no. 12: 2473. https://doi.org/10.3390/app8122473
APA StylePaluch, M., & Jackowska-Strumiłło, L. (2018). Hybrid Models Combining Technical and Fractal Analysis with ANN for Short-Term Prediction of Close Values on the Warsaw Stock Exchange. Applied Sciences, 8(12), 2473. https://doi.org/10.3390/app8122473