Stock Price Forecasting in Iran Stock Market: A Comparative Analysis of Deep-learning Approaches

Document Type : Original Article

Authors

1 Graduate School of Management and Economics, Sharif University of Technology, Tehran, Iran

2 School of Railway Engineering, Iran University of Science and Technology, Tehran, Iran

10.22133/ijwr.2024.407077.1170

Abstract

The capital market plays a crucial role within a country's financial structure and is instrumental in funding significant, long-term projects. Investments in the railway transport industry are vital for boosting other economic areas and have a profound impact on macroeconomic dynamics. Nonetheless, the potential for delayed or uncertain returns may deter investors. Accurate predictions of rail company stock prices on exchanges are therefore vital for making informed investment choices and securing sustained investment. This study employs deep learning techniques to forecast the closing prices of MAPNA and Toucaril shares on the Tehran Stock Exchange. It utilizes deep neural networks, specifically One-dimensional Convolutional Neural Networks (1D-CNN), Long Short-Term Memory (LSTM) networks, and a combined CNN-LSTM model, for stock price prediction. The effectiveness of these models is measured using various metrics, including MAE, MSE, RMSE, MAPE, and R2. Findings indicate that deep learning methods can predict stock prices effectively, with the CNN-LSTM model outperforming others in this research. According to the results, The CNN-LSTM model reached the highest R2 of 0.992. Also, based on criteria such as MAE, MSE, RMSE, and MAPE the best results belong to LSTM (Kaggle-modified) with 521.715, 651119.194, 806.920, and 0.028, respectively.

Keywords

Main Subjects


  • Bodaghi, A. Owhadi, A. Khalili Nasr, and M. Khadem Sameni, “A Novel CNN-LSTM Model for Predicting the Railway Sector Stock Price in the Tehran Stock Exchange,” in International Conference on Web Research, Tehran, IEEE, 2023, pp. 108–114, https://doi.org/10.1109/ICWR57742.2023.10139258.
  • Dehghani, M. Ghasemzadeh, and H. Ansari-Samani, “Machine learning algorithms for time series in financial markets,” J. Soft Comput. Inf. Technol., vol. 8, no. 3, pp. 60–67, 2019.
  • Shah, H. Isah, and F. Zulkernine, “Stock Market Analysis: A Review and Taxonomy of Prediction Techniques,” Int. J. Financ. Stud., vol. 7, no. 2, p. 26, 2019, https://doi.org/10.3390/ijfs7020026.
  • Zhao et al., “Progress and prospects of data-driven stock price forecasting research,” International Journal of Cognitive Computing in Engineering, vol. 4, pp. 100–108, 2023, https://doi.org/10.1016/j.ijcce.2023.03.001.
  • R. Islam and N. Nguyen, “Comparison of Financial Models for Stock Price Prediction,” Risk Financ. Manag., vol. 13, no. 8, 2020, https://doi.org/10.3390/jrfm13080181.
  • Khashei and M. Bijari, “An artificial neural network (p,d,q) model for timeseries forecasting,” Expert Syst. Appl., vol. 37, no. 1, pp. 479–489, 2010, https://doi.org/10.1016/j.eswa.2009.05.044.
  • Faraz, “Prediction of Stock Price and Trend Changes of Stock Market Using Deep Learning,” M.Sc. dissertation, Dept. Elect. and Comp. Eng., K. N. Toosi University of Technology, 2020.
  • Aminimehr, A. Aminimehr, M. Pouromid, and A. Yekkehkhani, “A Time Step Cascade CNN-LSTM neural network for predicting adjusted close price of 5 largest firms in Tehran stock exchange,” The International Conference on Interdisciplinary Studies in Management and Engineering, Tehran, 2021, https://civilica.com/doc/1178787.
  • Nabipour, P. Nayyeri, H. Jabani, A. Mosavi, and E. Salwana, “Deep Learning for Stock Market Prediction,” Entropy, vol. 22, no. 8, 2020, https://doi.org/10.3390/e22080840.
  • Nikou, G. Mansourfar, and J. Bagherzadeh, “Stock price prediction using DEEP learning algorithm and its comparison with machine learning algorithms,” Intell. Syst. Account. Financ. Manag., vol. 26, no. 4, 2019, https://doi.org/10.1002/isaf.1459.
  • Faraz, H. Khaloozadeh, and M. Abbasi, “Stock Market Prediction-by-Prediction Based on Autoencoder Long Short-Term Memory Networks,” 2020 28th Iranian Conference on Electrical Engineering (ICEE), Tabriz, Iran, IEEE, 2020, https://doi.org/10.1109/ICEE50131.2020.9261055.
  • Faraz and H. Khaloozadeh, “Multi-Step-Ahead Stock Market Prediction Based on Least Squares Generative Adversarial Network,” 2020 28th Iranian Conference on Electrical Engineering (ICEE), Tabriz, Iran, IEEE, 2020, pp. 1-6, https://doi.org/10.1109/ICEE50131.2020.9260858.
  • B. Sezer, M. U. Gudelek, and A. M. Ozbayoglu, “Financial time series forecasting with deep learning : A systematic literature review: 2005–2019,” Appl. Soft Comput. J., vol. 90, p. 106181 2020, https://doi.org/10.1016/j.asoc.2020.106181.
  • Hu, Y. Zhao, and M. Khushi, “A Survey of Forex and Stock Price Prediction Using Deep Learning,” Appl. Syst. Innov., vol. 4, no. 1, p. 9, 2021, https://doi.org/10.3390/asi4010009.
  • Jiang, “Applications of deep learning in stock market prediction: recent progress,” Elsevier J., vol. 184, p. 115537, 2020, https://doi.org/10.1016/j.eswa.2021.115537.
  • M. Akhtar, A. S. Zamani, S. Khan, A. S. A. Shatat, S. Dilshad, and F. Samdani, “Stock market prediction based on statistical data using machine learning algorithms.” Journal of King Saud University – Science, vol. 34, no. 4, p. 101940, 2022, https://doi.org/10.1016/j.jksus.2022.101940.
  • Luo, Z. Ni, X. Zhu, P. Xia, and H. Wu, “A Novel Methanol Futures Price Prediction Method Based on Multicycle CNN-GRU and Attention Mechanism,” Arab. J. Sci. Eng., vol. 48, pp. 1487–1501, 2023, https://doi.org/10.1007/s13369-022-06902-6.
  • Leippold, Q. Wang, and W. Zhou, “Machine learning in the Chinese stock market,” J. financ. econ., vol. 145, no. 2, pp. 64–82, 2022, https://doi.org/10.1016/j.jfineco.2021.08.017.
  • Han, J. Kim, and D. Enke, “A machine learning trading system for the stock market based on N-period Min-Max labeling using XGBoost,” Expert Syst. Appl., vol. 211, p. 118581, 2023, https://doi.org/10.1016/j.eswa.2022.118581.
  • Zhang, L. Ye, and Y. Lai, “Stock Price Prediction Using CNN-BiLSTM-Attention Model,” Mathematics, vol. 11, no, 9, p. 1985, 2023, https://doi.org/10.3390/math11091985.
  • Chen, “Analysis of Bitcoin Price Prediction Using Machine Learning,” J. Risk Financ. Manag., vol. 16, no. 1, p. 51, 2023, https://doi.org/10.3390/jrfm16010051.
  • Saetia and J. Yokrattanasak, “Stock Movement Prediction Using Machine Learning Based on Technical Indicators and Google Trend Searches in Thailand,” Int. J. of Financial Stud., vol. 11, no. 1, p. 5, 2023, https://doi.org/10.3390/ijfs11010005.
  • Velay and F. Daniel, “Stock Chart Pattern Recognition with Deep Learning,” arXiv preprint arXiv:1808.00418, 2018, https://doi.org/10.48550/arXiv.1808.00418.
  • F. Fama, “Efficient capital markets: A review of theory and empirical work,” J. Finance, vol. 25, no. 2, pp. 383–417, 1970, https://doi.org/10.2307/2325486.
  • Almalis, E. Kouloumpris, and I. Vlahavas, “Sector-level sentiment analysis with deep learning,” Knowledge-Based Syst., vol. 258, p. 109954, 2022, https://doi.org/10.1016/j.knosys.2022.109954.
  • Li, Y. Li, H. Yang, L. Yang, and X.-Y. Liu, “DP-LSTM: Differential Privacy-inspired LSTM for Stock Prediction Using Financial News,” arXiv preprint arXiv:1912.10806, 2019, https://doi.org/10.48550/arXiv.1912.10806.
  • Gangopadhyay and P. Majumder, “Text representation for direction prediction of share market,” Expert Syst. Appl., vol. 211, p. 118472, 2023, https://doi.org/10.1016/j.eswa.2022.118472.
  • R. Dahal et al., “A comparative study on effect of news sentiment on stock price prediction with deep learning architecture,” PLoS One, vol. 18, p. e0284695, 2023, https://doi.org/10.1371/journal.pone.0284695.
  • Kalyoncu, A. Jamil, E. Karatas, J. Rasheed, and C. Djeddi, “Stock Market Value Prediction Using Deep Learning,” DATA Sci. Appl., vol. 3, no. 2, pp. 10-14, 2020.
  • A. Hargreaves and C. Leran, “Stock Prediction Using Deep Learning with Long-Short-Term-Memory Networks,” Int. J. Electron. Eng. Comput. Sci., vol. 5, no. 3, pp. 22–32, 2020.
  • Mazin A. M. Al Janabi, “Dealing with the Problem of Missing Data: A Short Note.” EGADE Business School, 2018.
  • Timuri Pabandi, "Portfolio optimization in the Iranian stock market", University of Tehran, 2019.
  • Baguley, “Dealing with missing data. Online Supplement 2 to Serious stats: A guide to advanced statistics for the behavioral sciences. Basingstoke: Palgrave,”In Serious stats: A guide to advanced statistics for the behavioral sciences, Palgrave, 2012.
  • Pal and P. Prakash, Practical Time Series Analysis, Packt, 2017.
  • Liang, ZhaodiGe, L. Sun, MaoweiHe, and H. Chen, “LSTM with Wavelet Transform Based Data Preprocessing for Stock Price Prediction,” Math. Probl. Eng., 2019, https://doi.org/10.1155/2019/1340174.
  • Lu, J. Li, Y. Li, A. Sun, and J. Wang, “A CNN-LSTM-Based Model to Forecast Stock Prices,” Complexity, 2020, https://doi.org/10.1155/2020/6622927.
  • Sayah, “Stock Market Analysis + Prediction using LSTM | Kaggle.” https://www.kaggle.com/faressayah/stock-market-analysis-prediction-using-lstm (accessed Jun. 14, 2023).
  • B. Shahi, A. Shrestha, A. Neupane, and W. Guo, “Stock Price Fore, no. casting with Deep Learning: A Comparative Study,” Mathematics, vol. 8, no. 9, p. 1441, 2020, https://doi.org/10.3390/math8091441.
  • K. Lakshminarayanan and J. McCrae, “A Comparative Study of SVM and LSTM Deep Learning Algorithms for Stock Market Prediction,” In AICS, 2019, pp. 446-457.
  • Tsang, J. Deng, and X. Xie, “Recurrent Neural Networks for Financial Time-Series Modelling,” 2018 24th International Conference on Pattern Recognition (ICPR), IEEE, 2018, pp. 892-897, https://doi.org/10.1109/ICPR.2018.8545666.
  • Gao, R. Zhang, and X. Yang, “The Application of Stock Index Price Prediction with Neural Network,” Math. Comput. Appl., vol. 25, no. 3, p. 53, 2020, https://doi.org/10.3390/mca25030053.
  • Liu, F. Chao, Y. C. Lin, and C. M. Lin, “Stock Prices Prediction using Deep Learning Models,” arXiv preprint arXiv:1909.12227, 2019, https://doi.org/10.48550/arXiv.1909.12227.
  • Bao, J. Yue, and Y. Rao, “A deep learning framework for financial time series using stacked autoencoders and long-short term memory,” PLoS One, vol. 12, no. 7, p. e0180944, 2017, https://doi.org/10.1371/journal.pone.0180944.
  • Zhang, G. Zhong, J. Dong, S. Wang, and Y. Wang, “Stock Market Prediction Based on Generative Adversarial Network,” Procedia computer science, vol. 147, pp. 400-406, 2019, https://doi.org/10.1016/j.procs.2019.01.256.
  • Kim and H. Y. Kim, “Forecasting stock prices with a feature fusion LSTM-CNN model using different representations of the same data,” PLoS One, vol. 14, no. 2, p. e0212320 2019, https://doi.org/10.1371/journal.pone.0212320.
  • A. Hossain, R. Karim, R. Thulasiram, N. D. B. Bruce, and Y. Wang, “Hybrid Deep Learning Model for Stock Price Prediction,” 2018 IEEE Symposium Series on Computational Intelligence (SSCI), Bangalore, India, 2018, pp. 1837-1844, https://doi.org/10.1109/SSCI.2018.8628641.2018.