Deep learning-based price forecasting in Tehran Stock Exchange: LSTM and 1D CNN approaches
Subject Areas : Financial Markets and Institutions
Hossein Mostafaienia
1
,
Kaebeh Yaeghoobi
2
,
Omid Mahdi Ebadati Esfahani
3
1 - Department of Operation Management and Information Technology, Kharazmi university, Tehran, Iran.
2 - Department of Computer Engineering, K. N. Toosi University of Technology, Tehran, Iran.
3 - Department of Operation Management and Information Technology, Kharazmi university, Tehran, Iran.
Keywords: Convolutional Neural Network, Deep Learning, Long-Term Short-Term Memory, Stock Market Forecasting, Tehran Stock Exchange,
Abstract :
Purpose: The stock index and share prices reflect economic health and market reactions to financial decisions. Therefore, their precise analysis plays a critical role in evaluating the performance of forecasting models. Predicting market movements—particularly in the volatile Tehran Stock Exchange—requires models capable of analyzing nonlinear time series data. This study aims to design a deep learning-based model for predicting the next day’s closing price of stocks by developing a hybrid structural framework that remains reliable even under unstable market conditions.
Research Methodology: The dataset consists of daily trading data from the Tehran Stock Exchange between 2008 and 2021, covering 3,014 trading days. Variables include daily closing, opening, high, low prices, trade volume, and transaction value. After data cleaning and normalization, a sliding window method was applied to generate trainable sequences. The proposed model combines a one-dimensional convolutional layer (1D-CNN) for feature extraction, two long short-term memory (LSTM) layers for capturing temporal dependencies, and multiple dense layers for nonlinear learning. Experiments were conducted in Python, and various scenarios were tested, including excluding turbulent data and adjusting the model’s architecture.
Findings: Empirical results demonstrate that the hybrid CNN-LSTM model achieves accurate performance when applied to normalized daily stock data. The mean absolute error (MAE) ranged from 0.56 to 0.63, and the mean absolute percentage error (MAPE) varied between 1.26% and 1.46%. The model maintained stable performance in medium-term forecasts (up to 60 days), aligning well with actual market trends. Higher accuracy was observed for stocks with smoother price behavior, and the model successfully reconstructed price structures even in volatile symbols.
Originality / Value: The innovation of this research lies in designing a robust, generalizable framework resistant to extreme volatility. Through extensive testing on individual symbols, robustness analyses under data removal, and reconstruction of complex price structures, the study opens new avenues for the development of intelligent trading systems. The model’s adaptability to turbulent, incomplete, and structurally diverse data from Iran’s stock market makes it a suitable foundation for implementing decision-support systems in nonlinear and unstable financial environments.
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.
Billah, M. M., Sultana, A., Bhuiyan, F., & Kaosar, M. G. (2024). Stock price prediction: comparison of different moving average techniques using deep learning model. Neural Computing and Applications, 36(11), 5861-5871.
Chatzis, S. P., Siakoulis, V., Petropoulos, A., Stavroulakis, E., & Vlachogiannakis, N. (2018). Forecasting stock market crisis events using deep and statistical machine learning techniques. Expert systems with applications, 112, 353-371.
Eapen, J., Bein, D., & Verma, A. (2019). Novel deep learning model with CNN and bi-directional LSTM for improved stock market index prediction. In 2019 IEEE 9th annual computing and communication workshop and conference (CCWC), 0264-0270.
Ebadati, O. M., Jafari, M. A., & Davoodifar, N. (2022). Forecasting Stocks in the Financial Market by Using GA-SVM Hybrid Algorithm. Advances in Finance and Investment, 2(5), 1-22. [In Persian]
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.
Fukushima, K. (1980). Neocognitron: A self-organizing neural network model for a mechanism of pattern recognition unaffected by shift in position. Biological cybernetics, 36(4), 193-202.
Géron, A. (2022). Hands-on machine learning with Scikit-Learn, Keras, and TensorFlow. O'Reilly Media.
Gholami, N., & Shams Gharne, N. (2024). Presenting an optimized CNN-LSTM model for stock price forecasting in the tehran stock exchange. Financial Management Perspective, 14(45), 123-147. [In Persian]
Gülmez, B. (2023). Stock price prediction with optimized deep LSTM network with artificial rabbits optimization algorithm. Expert Systems with Applications, 227, 120346.
Hamshi, M., Bonabi Ghadim, R., & Mohammadzadeh Salteh, H. (2025). The role of information disclosure dimensions on pricing the probability of using confidential information. Advances in Finance and Investment, 6(1), 135-164. [In Persian]
Heidarzadeh, M., Safa, M., Fallahshams, M., & Jahangir Nia, H. (2024). Predictability of Tehran Stock Exchange using deep learning models (CNN-LSTM model). Journal of Modern Management Engineering, 10(3), 155-170. [In Persian]
Hubel, D. H., & Wiesel, T. N. (1968). Receptive fields and functional architecture of monkey striate cortex. The Journal of physiology, 195(1), 215-243.
Li, X., Li, Y., Yang, H., Yang, L., & Liu, X. Y. (2019). DP-LSTM: Differential privacy-inspired LSTM for stock prediction using financial news. arXiv preprint arXiv:1912.10806.
Mohamadi, R., Saedi, R., & Dastgir, M. (2024). Investigating the effect of stock idiosyncratic and cash flow volatility on the future stock price crash risk. Advances in Finance and Investment, 5(4), 175-206. [In Persian]
Noorbakhsh, A., & Shaygani, M. (2024). Forecasting stock prices in the capital market with an artificial intelligence approach. Journal of Economic Business Research, 15(33), 1-18. [In Persian]
Olah, C. (2015). Understanding lstm networks. Colah Github.
Selvin, S., Vinayakumar, R., Gopalakrishnan, E. A., Menon, V. K., & Soman, K. P. (2017). Stock price prediction using LSTM, RNN and CNN-sliding window model. In 2017 international conference on advances in computing, communications and informatics (ICACCI), 1643-1647.
Shen, S., Jiang, H., & Zhang, T. (2012). Stock market forecasting using machine learning algorithms. Department of Electrical Engineering, Stanford University, Stanford, CA, 1-5.
Sohrabi, M., Mozaffar, S., Mozaffar Mirbargkar, S., Chirani, E., & Kheradyar, S. (2022). Modeling the prediction of stock market jumps based on the recurrent neural network and deep learning. Journal of Securities Exchange, 15(59), 245-268. [In Persian]
Sonkavde, G., Dharrao, D. S., Bongale, A. M., Deokate, S. T., Doreswamy, D., & Bhat, S. K. (2023). Forecasting stock market prices using machine learning and deep learning models: A systematic review, performance analysis and discussion of implications. International Journal of Financial Studies, 11(3).
Stempień, D., & Ślepaczuk, R. (2025). Hybrid Models for Financial Forecasting: Combining Econometric, Machine Learning, and Deep Learning Models. arXiv preprint arXiv:2505.19617.
Toraby Pour, T., & Siadat, S. (2023). A way to predict the stock price of the Tehran Stock Exchange in relation to knowledge. Electronic and Cyber Defense, 10(4), 91-100. [In Persian]
Tsay, R. S. (2005). Analysis of financial time series. John wiley & sons.
Zhang, K., Zhong, G., Dong, J., Wang, S., & Wang, Y. (2019). Stock market prediction based on generative adversarial network. Procedia computer science, 147, 400-406.
Zolfaghari, M., Sahabi, B., & Bakhtyaran, M. J. (2020). Designing a Model for Forecasting the Stock Exchange Total Index Returns (Emphasizing on Combined Deep Learning Network Models and GARCH Family Models). Financial Engineering and Portfolio Management, 11(42), 138-171. [In Persian]