Deep Learning-based Modeling for Stock Price Prediction in Iran

Document Type : Research Paper

Authors

1 Ph.D. Candidate, Department of Economics, Semnan University, Semnan, Iran.

2 Prof., Department of Economics, Semnan University, Semnan, Iran.

3 Assistant Prof., Department of Economics, Virginia Tech, Blacksburg, USA.

10.22059/frj.2025.383898.1007656

Abstract

Objective
This study aims to propose an innovative approach for forecasting stock closing prices using supervised deep learning techniques. The research seeks to capture temporal dependencies within stock market data and generate accurate and reliable predictions. By focusing on the Iranian stock market—a developing economy that has received limited attention in prior research—and analyzing 10 stocks over a period exceeding 10 years (2012–2023) using 21 input variables, the study investigates distinctive aspects of stock price prediction.
 
Methods
The methodology involves integrating Long Short-Term Memory (LSTM) networks with deep learning techniques. Identifying a research gap in high-dimensional data, the study introduces the use of a Stack Supervised Autoencoder LSTM (SLSAE) to improve prediction accuracy. The study leverages LSTM neural networks to capitalize on their strong capabilities in modeling temporal dependencies. However, when dealing with high-dimensional data, relying on a single method may not be sufficient to achieve precise predictions. Therefore, we incorporate an LSTM Autoencoder (LAE) into the process. A key contribution of this paper is the use of the Supervised Autoencoder LSTM (LSAE), which significantly enhances prediction accuracy compared to previous methods. Furthermore, we utilize the Stack LSAE (SLSAE), which can identify and extract precise and valuable features from the data, ultimately leading to highly accurate predictions.
 
Results
To conduct a comprehensive comparison, we utilize five different prediction models: SLSAE, LSAE, LSTM, Artificial Neural Network (ANN), and ARIMA. The results show that the more complex models, particularly SLSAE and LSAE, outperform simpler models like ARIMA and ANN in terms of accuracy. Across all stocks, SLSAE achieved the best results across various metrics. This model provided the lowest RMSE, MSE, and MAE values and the highest R² scores. The superior performance is attributed to the use of a multi-layered supervised architecture, which enables the detection of complex and nonlinear patterns in the time-series data. These features make the model highly effective in capturing and predicting fine details of closing stock prices.
 
Conclusion
Predicting stock market prices is a significant challenge due to the inherent nonlinearity in the input data. When a wide range of variables are introduced as inputs, deep learning techniques demonstrate superior performance. To enhance the accuracy of stock market predictions, we utilized a deep learning architecture comprising SAE, LSAE, and a hybrid called SLSAE. The SLSAE method, however, stands out as it can directly learn deep features related to closing prices from raw input data. Unlike existing deep networks, which primarily focus on unsupervised feature learning to extract useful features from raw data, the SLSAE method can directly learn the deep features associated with closing prices. It employs a hierarchical structure, where high-level features related to closing prices are learned through building several SAE models from earlier low-level samples. Each SAE model ensures that the learned features significantly contribute to predicting price data in the output layer. Consequently, features associated with closing prices are gradually learned while irrelevant information is progressively reduced through the hierarchical stacking of SAE models. The results demonstrate that using this approach significantly improves the accuracy of stock price predictions and confirms the efficiency of the proposed method.

Keywords

Main Subjects


 
Abbasimehr, H., Shabani, M. & Yousefi, M. (2020). An optimized model using LSTM network for demand forecasting. Computers & Industrial Engineering, 143, 106435.
Abounoori, E. & Tazehabadi, A. G. (2009, April). Forecasting stock price using macroeconomic variables: A hybrid ardl, arima and artificial neural network. In 2009 International Conference on Information and Financial Engineering (pp. 149-153). IEEE.
Abounoori, E. & Tour, M. (2019). Stock market interactions among Iran, USA, Turkey, and UAE. Physica A: Statistical mechanics and its applications, 524, 297-305.
Abounoori, E., Elmi, Z. M. & Nademi, Y. (2016). Forecasting Tehran stock exchange volatility; Markov switching GARCH approach. Physica A: Statistical Mechanics and its Applications, 445, 264-282.
Acuna-García, J. A., Luz Canchola-Magdaleno, S. & Olmos Trejo, C. A. (2022). Stock Market Forecasting Using Continuous Wavelet Transform And Long Short-Term Memory Neural Networks. International Journal of Advanced Research in Computer Science, 13(6).
Afsharirad, E., Alavi, S. E. & Sinaei, H. (2018). Developing an Intelligent Model to Predict Stock Trend Using the Technical Analysis. Financial Research Journal, 20(2), 249-264. (in Persian)
Al-Khasawneh, M. A., Raza, A., Khan, S. U. R. & Khan, Z. (2024). Stock Market Trend Prediction Using Deep Learning Approach. Computational Economics, 66(1), 453-484.
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.
Basak, S., Kar, S., Saha, S., Khaidem, L. & Dey, S. R. (2019). Predicting the direction of stock market prices using tree-based classifiers. The North American Journal of Economics and Finance, 47, 552–567.
Bhandari, H. N., Rimal, B., Pokhrel, N. R., Rimal, R., Dahal, K. R. & Khatri, R. K. (2022). Predicting stock market index using LSTM. Machine Learning with Applications, 9, 100320.
Bieganowski, B. & Slepaczuk, R. (2024). Supervised Autoencoder MLP for Financial Time Series Forecasting. Journal of Big Data, 12(1), 207.
Bollerslev, T. (1986). Generalized autoregressive conditional heteroskedasticity. Journal of econometrics, 31(3), 307-327.
Box, G. E., Jenkins, G. M., Reinsel, G. C. & Ljung, G. M. (2015). Time series analysis: forecasting and control. John Wiley & Sons.
Breiman, L. (2001). Random forests. Machine learning, 45, 5-32.
Brown, R. G. (2004). Smoothing, forecasting and prediction of discrete time series. Courier Corporation.
Budiharto, W. (2021). Data science approach to stock prices forecasting in Indonesia during Covid-19 using Long Short-Term Memory (LSTM). Journal of big data, 8, 1-9.
Burges, C. J. (1998). A tutorial on support vector machines for pattern recognition. Data mining and knowledge discovery, 2(2), 121-167.
Chandar, S. K. (2024). Deep learning framework for stock price prediction using long short-term memory. Soft Computing, 28(17), 10557-10567.
Chen, Y. J. & Hao, Y. J. (2018). Integrating principle component analysis and weighted support vector machine for stock trading signals prediction. Neuro- computing, (321), 381–402.
Cheng, J., Zhao, W., Liu, J., Xie, X., Wu, S., Liu, L., ... & Liu, J. (2021a). Automated diagnosis of covid-19 using deep supervised autoencoder with multi-view features from CT images. IEEE/ACM Transactions on Computational Biology and Bioinformatics, 19(5), 2723-2736.
Cheng, Y., Hu, K., Wu, J., Zhu, H. & Shao, X. (2021b). Autoencoder quasi-recurrent neural networks for remaining useful life prediction of engineering systems. IEEE/ASME Transactions on Mechatronics, 27(2), 1081-1092.
Chourmouziadis, K. & Chatzoglou, P. D. (2016). An intelligent short term stock trading fuzzy system for assisting investors in portfolio management. Expert Systems with Applications, (43), 298–311.
Dami, S. & Esterabi, M. (2021). Predicting stock returns of Tehran exchange using LSTM neural network and feature engineering technique. Multimedia Tools and Applications, 80(13), 19947-19970.
Dezhkam, A. & Manzuri, M. T. (2023). Forecasting stock market for an efficient portfolio by combining XGBoost and Hilbert-Huang transform. Engineering Applications of Artificial Intelligence, 118, Article 105626.
Dhanuka, R., Tripathi, A. & Singh, J. P. (2022). A semi-supervised autoencoder-based approach for protein function prediction. IEEE Journal of Biomedical and Health Informatics, 26(10), 4957-4965.
Engle, R. F. (1982). Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation. Econometrica: Journal of the econometric society, 987-1007.
Fama, E. F. (1970). Efficient capital markets: A review of theory and empirical work. The journal of Finance, 25(2), 383-417.
Fama, E. F. (1995). Random walks in stock market prices. Financial analysts journal, 51(1), 75-80.
Fischer, T. & Krauss, C. (2018). Deep learning with long short-term memory networks for financial market predictions. European Journal of Operational Research, 270, 654–669.
Gandhmal, D. P. & Kumar, K. (2019). Systematic analysis and review of stock market prediction techniques. Computer Science Review, 34, 100190.
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.
Habibnia, A. (2016). Essays in high-dimensional nonlinear time series analysis (Doctoral dissertation, London School of Economics and Political Science).
Habibnia, A. & Maasoumi, E. (2021). Forecasting in big data environments: an adaptable and automated shrinkage estimation of neural networks (AAShNet). Journal of Quantitative Economics, 19(Suppl 1), 363-381.
Hadizadeh, A., Tarokh, M. J. & Mirzaee Ghazani, M. (2022). Forecasting Stock market behavior through implementing technical indicators, based on deep reinforcement learning and convolutional network approaches Case study: Iran Stock Market. Modern Research in Decision Making, 7(4), 51-80. (in Persian)
Hamayel, M. J. & Owda, A. Y. (2021). A novel cryptocurrency price prediction model using GRU, LSTM and bi-LSTM machine learning algorithms. AI, 2(4), 477-496.
Haykin, S. (1998). Neural networks: a comprehensive foundation. Prentice Hall PTR.
Heidari, M. & Amiri, H. (2022). Inspecting the Predictive Power of Artificial Intelligence Models in Predicting the Stock Price Trend in Tehran Stock Exchange. Financial Research Journal, 24(4), 602-623. (in Persian)
Holland, J. H. (1992). Adaptation in natural and artificial systems: an introductory analysis with applications to biology, control, and artificial intelligence. MIT press.
Hu, Y., Sun, X., Nie, X., Li, Y. & Liu, L. (2019). An enhanced LSTM for trend following of time series. IEEE Access, 7, 34020-34030.
Ismail, M. S., Noorani, M. S. M., Ismail, M., Razak, F. A. & Alias, M. A. (2020). Predicting next day direction of stock price movement using machine learning methods with persistent homology: Evidence from Kuala Lumpur Stock Exchange. Applied Soft Computing, 93, 106422.
Izadi, M., Ashtab, A. & Zavari Rezaei, A. (2025). Comparing the Estimation Power of Machine Learning Models and Statistical Models in Predicting Profit Component Changes and Selecting the Optimal Model. Financial Research Journal, 27(1), 31-57. (in Persian)
Jiang, W. (2021). Applications of deep learning in stock market prediction: recent progress. Expert Systems with Applications, 184, 115537.
Jirou, I., Jebabli, I. & Lahiani, A. (2025). A hybrid deep learning model for cryptocurrency returns forecasting: Comparison of the performance of financial markets and impact of external variables. Research in International Business and Finance, 73, 102575.
Kanwal, A., Lau, M. F., Ng, S. P., Sim, K. Y. & Chandrasekaran, S. (2022). BiCuDNNLSTM-1dCNN—A hybrid deep learning-based predictive model for stock price prediction. Expert Systems with Applications, 202, Article 117123.
Kara, Y., Boyacioglu, M. A. & Baykan, O. 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), 5311–5319.
Khodaee, P., Esfahanipour, A. & Taheri, H. M. (2022). Forecasting turning points in stock price by applying a novel hybrid CNN-LSTM-ResNet model fed by 2D segmented images. Engineering Applications of Artificial Intelligence, 116, 105464.
Kim, S., Ku, S., Chang, W. & Song, J. W. (2020). Predicting the Direction of US Stock Prices Using Effective Transfer Entropy and Machine Learning Techniques. IEEE Access, 8, 111660–111682.
LeCun, Y., Bengio, Y. & Hinton, G. (2015). Deep Learning. nature, 521(7553), 436-444.
Lee, M. C., Chang, J. W., Yeh, S. C., Chia, T. L., Liao, J. S. & Chen, X. M. (2022). Applying attention-based BiLSTM and technical indicators in the design and performance analysis of stock trading strategies. Neural Computing and Applications, 34(16), 13267-13279.
Liu, C., Wang, Y., Wang, K. & Yuan, X. (2021). Deep learning with nonlocal and local structure preserving stacked autoencoder for soft sensor in industrial processes. Engineering Applications of Artificial Intelligence, 104, 104341.
Liu, P., Sun, X., Han, Y., He, Z., Zhang, W. & Wu, C. (2022). Arrhythmia classification of LSTM autoencoder based on time series anomaly detection. Biomedical Signal Processing and Control, 71, 103228.
Long, W., Lu, Z. & Cui, L. (2019). Deep learning-based feature engineering for stock price movement prediction. Knowledge-Based Systems, (164), 163–173.
Lübbering, M., Gebauer, M., Ramamurthy, R., Sifa, R. & Bauckhage, C. (2021). Supervised autoencoder variants for end to end anomaly detection. In Pattern Recognition. ICPR International Workshops and Challenges: Virtual Event, January 10–15, 2021, Proceedings, Part II (pp. 566-581). Springer International Publishing.
Mehtab S., Sen J. & Dutta A. (2020). Stock price prediction using machine learning and LSTM-based deep learning models. arXiv preprint arXiv:2009.10819.
Moghar, A. & Hamiche, M. (2020). Stock market prediction using LSTM recurrent neural network. Procedia Computer Science, 170, 1168-1173.
Mohebi, S., Fadaeinejad, M. E., Osoolian, M. & Hamidizadeh, M. R. (2022). Feature Selection for the Prediction Model of the Tehran Stock Exchange Index by Dimensionality Reduction Techniques. Financial Research Journal, 24(4), 577-601. (in Persian)
Moradi, M., Neshat, N. & Sardari, M. (2025). Display investment knowledge in terms of returns in Iran's stock market using deep neural models in environmental uncertainty. Financial Research Journal, 27(3), 531-565. (in Persian)
Nabipour, M., Nayyeri, P., Jabani, H., Shahab, S. & Mosavi, A. (2020). Predicting Stock Market Trends Using Machine Learning and Deep Learning Algorithms Via Continuous and Binary Data; a Comparative Analysis. IEEE Access, 8, 150199–150212.
Naik, N. & Mohan, B. R. (2019). Study of stock return predictions using recurrent neural networks with LSTM. In Engineering Applications of Neural Networks: 20th International Conference, EANN 2019, Xersonisos, Crete, Greece, May 24-26, 2019, Proceedings 20 (pp. 453-459). Springer International Publishing.
Nam, H. S., Jeong, Y. K. & Park, J. W. (2020, October). An anomaly detection scheme based on LSTM autoencoder for energy management. In 2020 international conference on information and communication technology convergence (ICTC) (pp. 1445-1447). IEEE.
Nguyen, H. D., Tran, K. P., Thomassey, S. & Hamad, M. (2021). Forecasting and Anomaly Detection approaches using LSTM and LSTM Autoencoder techniques with the applications in supply chain management. International Journal of Information Management, 57, 102282.
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.
Osoolian, M., Nikmaram, A. & Karimi, M. (2025). Predicting Index Trend Using Hybrid Neural Networks with a Focus on Multi-Scale Temporal Feature Extraction in the Tehran Stock Exchange. Financial Research Journal, 27(1), 85-113. (in Persian)
Paiva, F. D. A, Cardoso, R. T. N., Hanaoka, G. P. & Duarte, W. M. (2019). Decision–making for financial trading: A fusion approach of machine learning and port- folio selection. Expert Systems with Applications, (115), 635–655.
Patel, J., Shah, S., Thakkar, P. & Kotecha, K. (2015). Predicting stock and stock price index movement using trend deterministic data preparation and machine learn- ing techniques. Expert Systems with Applications, (42), 259–268.
Qin, Y., Yang, J., Zhou, J., Pu, H. & Mao, Y. (2023). A new supervised multi-head self-attention autoencoder for health indicator construction and similarity-based machinery RUL prediction. Advanced Engineering Informatics, 56, 101973.
Quinlan, J. R. (1986). Induction of decision trees. Machine learning, 1, 81-106.
Rajabi, M. & Khaloozadeh, H. (2023). New approaches in modeling and forecasting financial markets: recent progress and future horizons. Journal of Control, 17(2), 149-163.
(in Persian)
Ranjan, A., Mahadani, Kumar, A. (2022). Stock price prediction using deep learning-based univariate and multivariate LSTM and RNN. In: Sikdar Biplab, R.A., Prasad, Maity (Eds.), Proceedings of the 3rd International Conference on Communication, Devices and Computing. Springer Singapore, Singapore, pp. 95–103.
Rather, A. M. (2021). LSTM-Based deep learning model for stock prediction and predictive optimization model. EURO Journal on Decision Processes, 9, 100001.
Ren, X., Xu, W. & Duan, K. (2022). Fourier transform based LSTM stock prediction model under oil shocks. Quantitative Finance and Economics, 6(2), 342–358.
SaeidiAghdam, M., Sadeghi, A., Bahiraie, A. & HajiAsghari, S. Y. (2023). Provide a stock price forecasting model using deep learning algorithms and its use in the pricing of Islamic bank stocks. Journal of Islamic Economics and Banking, 11(41), 117-134.
(in Persian)
Saumya, S. & Singh, J. P. (2022). Spam review detection using LSTM autoencoder: an unsupervised approach. Electronic Commerce Research, 22(1), 113-133.
Shahi, T. B., Shrestha, A., Neupane, A. & Guo, W. (2020). Stock price forecasting with deep learning: A comparative study. Mathematics, 8(9), 1441.
Shao, L., Wu, D. & Li, X. (2014). Learning deep and wide: A spectral method for learning deep networks. IEEE Transactions on Neural Networks and Learning Systems, 25(12), 2303-2308.
Sharma, M. & Shekhawat, H. S. (2022). Portfolio optimization and return prediction by integrating modified deep belief network and recurrent neural network. Knowledge- Based Systems, 109024.
Singh, R. & Srivastava, S. (2017). Stock prediction using deep learning. Multimedia Tools and Applications, 76(18), 18569–18584.
Sohrabi, M., Mirbargkar, S. M., 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)
Torabypour, 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)
Vijh, M., Chandola, D., Tikkiwal, V. A. & Kumar, A. (2020). Stock Closing Price Prediction using Machine Learning Techniques. Procedia Computer Science, 167, 599–606.
Wan, A., Chang, Q., Khalil, A. B. & He, J. (2023). Short-term power load forecasting for combined heat and power using CNN-LSTM enhanced by attention mechanism. Energy, 282, 128274.
Wang, Z., Su, X. & Ding, Z. (2020). Long-term traffic prediction based on lstm encoder-decoder architecture. IEEE Transactions on Intelligent Transportation Systems, 22(10), 6561-6571.
Wu, D., Wang, X. & Wu, S. (2022). A Hybrid Framework Based on Extreme Learning Machine, Discrete Wavelet Transform, and Autoencoder with Feature Penalty for Stock Prediction. Expert Systems with Applications, 118006.
Wu, D., Wang, X. & Wu, S. (2022). Jointly modeling transfer learning of industrial chain information and deep learning for stock prediction. Expert Systems with Applications, 191, 116257.
Yu, P. & Yan, X. (2020). Stock price prediction based on deep neural networks. Neural Computing and Applications, 32, 1609-1628.
Yuan, X., Gu, Y., Wang, Y., Yang, C. & Gui, W. (2019). A deep supervised learning framework for data-driven soft sensor modeling of industrial processes. IEEE transactions on neural networks and learning systems, 31(11), 4737-4746.
Yuan, X., Li, L., Wang, Y., Yang, C. & Gui, W. (2020a). Deep learning for quality prediction of nonlinear dynamic processes with variable attention‐based long short‐term memory network. The Canadian Journal of Chemical Engineering, 98(6), 1377-1389.
Yuan, X., Qi, S. & Wang, Y. (2020b). Stacked enhanced auto-encoder for data-driven soft sensing of quality variable. IEEE Transactions on Instrumentation and Measurement, 69(10), 7953-7961.
Yuan, X., Wang, Y., Yang, C. & Gui, W. (2020c). Stacked isomorphic autoencoder based soft analyzer and its application to sulfur recovery unit. Information Sciences, 534, 72-84.
Zadeh, L. A. (1965). Fuzzy sets. Information and control, 8(3), 338-353.
Zokaei, S., Sanaei, M. & Mirzapour Babajan, A. (2024). An intelligent stock price forecasting model based on deep learning: with dimensionality reduction approach. Journal of Intelligent Marketing Management, 5(3), 299-324. (in Persian)