Developing a Stock Market Prediction Model by Deep Learning Algorithms

Document Type : Research Paper

Authors

1 Department of Finance, Esfarayen Branch, Islamic Azad University, Esfarayen, Iran

2 Department of Finance, Esfarayen Branch, Islamic Azad University, Esfarayen, Iran.

Abstract

For investors, predicting stock market changes has always been attractive and challenging because it helps them accurately identify profits and reduce potential risks. Deep learning-based models, as a subset of machine learning, receive attention in the field of price prediction through the improvement of traditional neural network models. In this paper, we propose a model for predicting stock prices of Tehran Stock Exchange companies using a long-short-term memory (LSTM) deep neural network. The model consists of two LSTM layers, one Dense layer, and two DropOut layers. In this study, using our studies and evaluations, the adjusted stock price with 12 technical index variables was taken as an input for the model. In assessing the model's predictive outcomes, we considered RMSE, MAE, and MAPE as criteria. According to the results, integrating technical indicators increases the model's accuracy in predicting the stock price, with the LSTM model outperforming the RNN model in this task.

Keywords

Main Subjects


Aali-Bujari, A., Venegas-Martínez, F., & Pérez-Lechuga, G. (2017). Impact of the stock market capitalization and the banking spread on growth and development in Latin America: A panel data estimation with System GMM. Contaduría y Administración, 62(5), 1427-1441.
Arévalo, A., Niño, J., Hernández, G., & Sandoval, J. (2016). High-frequency trading strategy based on deep neural networks. In S. Fujita, D. Slezak, & M. Paprzycki (Eds.), Intelligent Computing Methodologies: 12th International Conference, ICIC 2016, Lanzhou, China, August 2-5, 2016, Proceedings, Part III (pp. 424-436). Springer International Publishing.
Atsalakis, G. S., & Valavanis, K. P. (2009). Surveying stock market forecasting techniques–Part II: Soft computing methods. Expert Systems with Applications, 36(3), 5932-5941.
Bao, W., Yue, J., & Rao, Y. (2017). A deep learning framework for financial time series using stacked autoencoders and long-short term memory. PloS One, 12(7), e0180944.
Brown, M. S., Pelosi, M. J., & Dirska, H. (2013). Dynamic-radius species-conserving genetic algorithm for the financial forecasting of Dow Jones index stocks. In P. Perner (Ed.), Machine Learning and Data Mining in Pattern Recognition: 9th International Conference, MLDM 2013, New York, NY, USA, July 19-25, 2013. Proceedings 9 (pp. 27-41). Springer Berlin Heidelberg.
Chen, K., Zhou, Y., & Dai, F. (2015, October). A LSTM-based method for stock returns prediction: A case study of China stock market. In 2015 IEEE International Conference on Big Data (Big Data) (pp. 2823-2824). IEEE.
Chollet, F. et al. (2015). Keras. Retrieved from https://keras.io.
Chung, H., & Shin, K. S. (2020). Genetic algorithm-optimized multi-channel convolutional neural network for stock market prediction. Neural Computing and Applications, 32, 7897-7914.
Deng, L., & Yu, D. (2014). Deep learning: Methods and applications. Foundations and Trends® in Signal Processing, 7(3–4), 197-387.
Di Persio, L., & Honchar, O. (2016). Artificial neural networks architectures for stock price prediction: Comparisons and applications. International Journal of Circuits, Systems and Signal Processing, 10(2016), 403-413.
Doaei, M., Mirzaei, S. A., & Rafigh, M. (2021). Hybrid multilayer perceptron neural network with grey wolf optimization for predicting stock market index. Advances in Mathematical Finance and Applications, 6(4), 883-894.
Ferdiansyah, F., Othman, S. H., Radzi, R. Z. R. M., Stiawan, D., Sazaki, Y., & Ependi, U. (2019, October). A LSTM-method for bitcoin price prediction: A case study yahoo finance stock market. In 2019 International Conference on Electrical Engineering and Computer Science (ICECOS) (pp. 206-210). IEEE.
Fischer, T., & Krauss, C. (2018). Deep learning with long short-term memory networks for financial market predictions. European Journal of Operational Research, 270(2), 654-669.
Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep learning. MIT press.
Gordon, E., & Natarajan, K. (2009). Financial markets and services. Mumbai: Himalaya Publishing House.
Gunduz, H., Yaslan, Y., & Cataltepe, Z. (2017). Intraday prediction of Borsa Istanbul using convolutional neural networks and feature correlations. Knowledge-Based Systems, 137, 138-148.
Guresen, E., Kayakutlu, G., & Daim, T. U. (2011). Using artificial neural network models in stock market index prediction. Expert Systems with Applications, 38(8), 10389-10397.
Heidari, A. A., Faris, H., Aljarah, I., & Mirjalili, S. (2019). An efficient hybrid multilayer perceptron neural network with grasshopper optimization. Soft Computing, 23, 7941-7958.
Hiransha, M., Gopalakrishnan, E. A., Menon, V. K., & Soman, K. P. (2018). NSE stock market prediction using deep-learning models. Procedia Computer Science, 132, 1351-1362.
Hoseinzade, E., & Haratizadeh, S. (2019). CNNpred: CNN-based stock market prediction using a diverse set of variables. Expert Systems with Applications, 129, 273-285.
Hu, Y., Feng, B., Zhang, X., Ngai, E. W. T., & Liu, M. (2015). Stock trading rule discovery with an evolutionary trend following model. Expert Systems with Applications, 42(1), 212-222.
Jiang, W. (2021). Applications of deep learning in stock market prediction: Recent progress. Expert Systems with Applications, 184, 115537.
Kara, Y., Boyacioglu, M. A., & Baykan, Ö. K. (2011). Predicting direction of stock price index movement using artificial neural networks and support vector machines: The sample of the Istanbul Stock Exchange. Expert Systems with Applications, 38(5), 5311-5319.
Khare, K., Darekar, O., Gupta, P., & Attar, V. Z. (2017, May). Short term stock price prediction using deep learning. In 2017 2nd IEEE International Conference on Recent Trends in Electronics, Information & Communication Technology (RTEICT) (pp. 482-486). IEEE.
Liu, S., Zhang, C., & Ma, J. (2017). CNN-LSTM neural network model for quantitative strategy analysis in stock markets. In Neural Information Processing: 24th International Conference, ICONIP 2017, Guangzhou, China, November 14-18, 2017, Proceedings, Part II 24 (pp. 198-206). Springer International Publishing.
Livieris, I. E., Kiriakidou, N., Stavroyiannis, S., & Pintelas, P. (2021). An advanced CNN-LSTM model for cryptocurrency forecasting. Electronics, 10(3), 287.
Markowitz, H. (1952). Portfolio selection. The Journal of Finance, 7(1), 77–91.
Mehtab, S., & Sen, J. (2020, November). Stock price prediction using CNN and LSTM-based deep learning models. In 2020 International Conference on Decision Aid Sciences and Application (DASA) (pp. 447-453). IEEE.
Menon, V. K., Chekravarthi Vasireddy, N., Jami, S. A., Pedamallu, V. T. N., Sureshkumar, V., & Soman, K. P. (2016). Bulk price forecasting using spark over nse data set. In Data Mining and Big Data: First International Conference, DMBD 2016, Bali, Indonesia, June 25-30, 2016. Proceedings 1 (pp. 137-146). Springer International Publishing.
Moghar, A., & Hamiche, M. (2020). Stock market prediction using LSTM recurrent neural network. Procedia Computer Science, 170, 1168-1173.
Mohanty, D. K., Parida, A. K., & Khuntia, S. S. (2021). Financial market prediction under deep learning framework using auto encoder and kernel extreme learning machine. Applied Soft Computing, 99, 106898.
Nabipour, M., Nayyeri, P., Jabani, H., Mosavi, A., & Salwana, E. (2020). Deep learning for stock market prediction. Entropy, 22(8), 840.
Naeini, M. P., Taremian, H., & Hashemi, H. B. (2010, October). Stock market value prediction using neural networks. In 2010 International Conference on Computer Information Systems and Industrial Management Applications (CISIM) (pp. 132-136). IEEE.
Nelson, D. M., Pereira, A. C., & De Oliveira, R. A. (2017, May). Stock market's price movement prediction with LSTM neural networks. In 2017 International Joint Conference on Neural Networks (IJCNN) (pp. 1419-1426). IEEE.
Nikou, M., Mansourfar, G., & Bagherzadeh, J. (2019). Stock price prediction using DEEP learning algorithm and its comparison with machine learning algorithms. Intelligent Systems in Accounting, Finance and Management, 26(4), 164-174.
Patel, J., Shah, S., Thakkar, P., & Kotecha, K. (2015). Predicting stock and stock price index movement using trend deterministic data preparation and machine learning techniques. Expert Systems with Applications, 42(1), 259-268.
Patel, M. M., Tanwar, S., Gupta, R., & Kumar, N. (2020). A deep learning-based cryptocurrency price prediction scheme for financial institutions. Journal of Information Security and Applications, 55, 102583.
Pokhrel, N. R., Dahal, K. R., Rimal, R., Bhandari, H. N., Khatri, R. K., Rimal, B., & Hahn, W. E. (2022). Predicting nepse index price using deep learning models. Machine Learning with Applications, 9, 100385.
Ramezanian, R., Peymanfar, A., & Ebrahimi, S. B. (2019). An integrated framework of genetic network programming and multi-layer perceptron neural network for prediction of daily stock return: An application in Tehran stock exchange market. Applied Soft Computing, 82, 105551.
Tsai, C. F., & Hsiao, Y. C. (2010). Combining multiple feature selection methods for stock prediction: Union, intersection, and multi-intersection approaches. Decision Support Systems, 50(1), 258-269.
Vidal, A., & Kristjanpoller, W. (2020). Gold volatility prediction using a CNN-LSTM approach. Expert Systems with Applications, 157, 113481.
Wang, J., & Wang, J. (2015). Forecasting stock market indexes using principle component analysis and stochastic time effective neural networks. Neurocomputing, 156, 68-78.
Yadav, A., Jha, C. K., & Sharan, A. (2020). Optimizing LSTM for time series prediction in Indian stock market. Procedia Computer Science, 167, 2091-2100.
Yong, B. X., Abdul Rahim, M. R., & Abdullah, A. S. (2017). A stock market trading system using deep neural network. In Modeling, Design and Simulation of Systems: 17th Asia Simulation Conference, AsiaSim 2017, Melaka, Malaysia, August 27–29, 2017, Proceedings, Part I 17 (pp. 356-364). Springer Singapore.
Zhang, G. P. (2003). Time series forecasting using a hybrid ARIMA and neural network model. Neurocomputing, 50, 159-175