Predicting the stock market is a widely studied field, either due to the curiosity in finding an explanation for the behavior of financial assets or for financial purposes. Among these studies the best techniques use neural networks as a prediction technique. More specifically, the best networks for this purpose are called recurrent neural networks (RNN) and provide an extra option when dealing with a sequence of values. However, a great part of the studies is intended to predict the result of few stocks, therefore, this work aims to predict the behavior of a large number of stocks. For this, similar stocks were grouped based on their correlation and later the algorithm K-means was applied so that similar groups were clustered. After this process, the Long Short-Term Memory (LSTM) - a type of RNN - was used in order to predict the price of a certain group of assets. Later, predicted prices are compared to the correct prices in order to analyze prices tendency. Results showed that clustering stocks did not influence the effectiveness of the network, once tendency was predicted correct for an average of 48% of time. Investors and portfolio managers can use proposed techniques to simply their daily tasks.
This is a preview of subscription content, log in to check access.
Buy single article
Instant access to the full article PDF.
Price includes VAT for USA
Subscribe to journal
Immediate online access to all issues from 2019. Subscription will auto renew annually.
This is the net price. Taxes to be calculated in checkout.
Selvin S, Vinayakumar R, Gopalakrishnan EA, Menon VK, Soman KP (2017) Stock price prediction using LSTM, RNN and CNN-sliding window model. In 2017 international conference on advances in computing, communications and informatics (icacci) (pp 1643-1647). IEEE
Sagheer A, Kotb M (2019) Time series forecasting of petroleum production using deep LSTM recurrent networks. Neurocomputing 323:203–213
Filho DBF, Júnior JAdS (2009) Desvendando os mistérios do coeficiente de correlacão de pearson (r). Universidade Federal de Pernambuco
Zhang J, Cui S, Xu Y, Li Q, Li T (2018) A novel data-driven stock price trend prediction system. Expert Syst Appl 97:60–69
LeCun Y, Bengio Y, Hinton G (2015) Deep learning. Nature 521(7553):436
Gerlein EA, McGinnity M, Belatreche A, Coleman S (2016) Evaluating machine learning classification for financial trading: an empirical approach. Expert Syst Appl 54:193–207
Krauss C, Do XA, Huck N (2017) Deep neural networks, gradient-boosted trees, random forests: statistical arbitrage on the S&P 500. Eur J Oper Res 259(2):689–702
Bini BS, Mathew T (2016) Clustering and regression techniques for stock prediction. Procedia Technol 24:1248–1255
Jung SS, Chang W (2016) Clustering stocks using partial correlation coefficients. Phys A: Statistical Mech Appl 462:410–420
Momeni M, Mohseni M, Soofi M (2015) Clustering stock market companies via K-means algorithm. Kuwait Chapter Arabian J Business Manag Rev 4(5):1–10
Nanda SR, Mahanty B, Tiwari MK (2010) Clustering Indian stock market data for portfolio management. Expert Syst Appl 37(12):8793–8798
Längkvist M, Karlsson L, Loutfi A (2014) A review of unsupervised feature learning and deep learning for time-series modeling. Pattern Recogn Lett 42:11–24
Kumar BS, Ravi V (2016) A survey of the applications of text mining in financial domain. Knowl-Based Syst 114:128–147
Cavalcante RC, Brasileiro RC, Souza VL, Nobrega JP, Oliveira AL (2016) Computational intelligence and financial markets: A survey and future directions. Expert Syst Appl 55:194–211
Chong E, Han C, Park FC (2017) Deep learning networks for stock market analysis and prediction: methodology, data representations, and case studies. Expert Syst Appl 83:187–205
Fischer T, Krauss C (2018) Deep learning with long short-term memory networks for financial market predictions. Eur J Oper Res 270(2):654–669
Nelson DM, Pereira AC, de Oliveira RA (2017) Stock market's price movement prediction with LSTM neural networks. In neural networks (IJCNN), 2017 international joint conference on (pp 1419-1426). IEEE
Shao X, Ma D, Liu Y, Yin Q (2017) Short-term forecast of stock price of multi-branch LSTM based on K-means. In 2017 4th International Conference on Systems and Informatics (ICSAI) (pp 1546-1551). IEEE
Python Software Foundation (2018) Python 3.5.5 documentation. Available at https://docs.python.org/3.5/
Chollet, F. (2015). Keras. Available at https://keras.io
Mirkin BG (1996) Mathematical classification and clustering. Kluwer Academic Publishing, Dordrecht
Affonso F, de Oliveira F, Dias TMR (2017) Uma Análise dos Fatores que Influenciam o Movimento Acionário das Empresas Petrolíferas. In Ibero-Latin Am Congress Computat Methods Eng (CILAMCE)
Gan G, Ma C, Wu J (2007) Data clustering: theory, algorithms, and applications (Vol. 20). Siam
Liu Y, Li Z, Xiong H, Gao X, Wu J (2010) Understanding of internal clustering validation measures. In ICDM:911–916
Ketchen DJ, Shook CL (1996) The application of cluster analysis in strategic management research: an analysis and critique. Strateg Manag J 17(6):441–458
Siami-Namini S, Tavakoli N, Namin AS (2018) A comparison of ARIMA and LSTM in forecasting time series. In 2018 17th IEEE International Conference on Machine Learning and Applications (ICMLA) (pp. 1394-1401). IEEE
Li Y, Jiang W, Yang L, Wu T (2018) On neural networks and learning systems for business computing. Neurocomputing 275:1150–1159
Bengio Y, Simard P, Frasconi P (1994) Learning long-term dependencies with gradient descent is difficult. IEEE Trans Neural Netw 5(2):157–166
Hochreiter S, Schmidhuber J (1997) Long short-term memory. Neural Comput 9(8):1735–1780
Conflicts of interest/competing interest
The code developed is available at: https://github.com/felipe-affonso/Financial-Times-Series-Forecasting-MONET
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
About this article
Cite this article
Affonso, F., Dias, T.M.R. & Pinto, A.L. Financial Times Series Forecasting of Clustered Stocks. Mobile Netw Appl (2020). https://doi.org/10.1007/s11036-020-01647-8
- Financial forecasting
- Clustering stocks
- Artificial neural networks