Abstract
Accurate stock price forecasting is a central challenge in financial prediction and risk management. This study focuses on forecasting the daily closing price of VCB stock listed on the Ho Chi Minh City Stock Exchange (HOSE) by applying three popular recurrent neural network (RNN) architectures—Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), and Bidirectional LSTM (BiLSTM). To enhance model performance and reproducibility, we propose a systematic hyperparameter optimization framework based on the Particle Swarm Optimization (PSO) algorithm. The proposed method automatically searches for optimal configurations of key hyperparameters (number of hidden units, dropout rate, learning rate, and batch size), thereby reducing the need for manual trial-and-error tuning. Experimental results demonstrate that PSO-based optimization significantly improves predictive accuracy across all three models, with the GRU architecture consistently outperforming its counterparts both before and after optimization, achieving RMSE = 0.6851 and R² = 0.9693. The study contributes a practical and replicable optimization approach and provides empirical evidence from the Vietnamese stock market, where comparative deep learning research remains limited. These findings carry important practical implications, enabling investors and portfolio managers to design evidence-based trading and risk management strategies that leverage recent advances in artificial intelligence within the field of financial management.
References
- J. S. Bhullar, “Developing a Time Series Financial Market Forecasting Model Based on Machine Learning Tools and Techniques,” IJTBM, vol. 14, no. 1, pp. 78–87, 2024, doi: 10.37648/ijtbm.v14i01.010.
- S. Syaharuddin, “Time-Series Analysis in Financial Prediction: A Literature Review | Syaharuddin | Sainstek : Jurnal Sains dan Teknologi,” Dec. 2024, doi: http://dx.doi.org/10.31958/js.v16i2.13117.
- G. J. Ross, “Modeling Financial Volatility in the Presence of Abrupt Changes,” Physica A: Statistical Mechanics and its Applications, vol. 392, no. 2, pp. 350–360, Jan. 2013, doi: 10.1016/j.physa.2012.08.015.
- T.-N. Nguyen, M.-N. Tran, D. Gunawan, and R. Kohn, “A Statistical Recurrent Stochastic Volatility Model for Stock Markets,” Jan. 22, 2022, arXiv: arXiv:1906.02884. doi: 10.48550/arXiv.1906.02884.
- M. Wiese, R. Knobloch, R. Korn, and P. Kretschmer, “Quant GANs: Deep Generation of Financial Time Series,” Quantitative Finance, vol. 20, no. 9, pp. 1419–1440, Sep. 2020, doi: 10.1080/14697688.2020.1730426.
- Y. Gao, R. Wang, and E. Zhou, “Stock Prediction Based on Optimized LSTM and GRU Models,” Scientific Programming, vol. 2021, pp. 1–8, Sep. 2021, doi: 10.1155/2021/4055281.
- Y. L. Sukestiyarno, D. T. Wiyanti, L. Azizah, and W. Widada, “Algorithm Optimizer in GA-LSTM for Stock Price Forecasting,” Contemp. Math., Jan. 2024, doi: 10.37256/cm.5120243367.
- G. Kumar, U. P. Singh, and S. Jain, “An adaptive particle swarm optimization-based hybrid long short-term memory model for stock price time series forecasting,” Soft Computing, vol. 26, no. 22, pp. 12115–12135, Aug. 2022, doi: 10.1007/s00500-022-07451-8.
- N. T. Co, H. H. Son, N. T. Hoang, T. T. P. Lien, and T. M. Ngoc, “Comparison Between ARIMA and LSTM-RNN for VN-Index Prediction,” Jan. 2020. doi: 10.1007/978-3-030-39512-4_168.
- S. Pasak and R. Jayadi, “Investment Decision on Cryptocurrency: Comparing Prediction Performance Using ARIMA and LSTM,” Journal of Information Systems and Informatics, vol. 5, pp. 407–427, May 2023, doi: 10.51519/journalisi.v5i2.473.
- N. T. Hương and B. Q. Trung, “Ứng dụng mô hình kết hợp ARIMA-GARCH để dự báo chỉ số VN-Index,” Tạp chí Khoa học và Công nghệ - Đại học Đà Nẵng, pp. 118–122, Apr. 2015.
- B. Aditya Pai, L. Devareddy, S. Hegde, and B. S. Ramya, “A Time Series Cryptocurrency Price Prediction Using LSTM,” in Emerging Research in Computing, Information, Communication and Applications, N. R. Shetty, L. M. Patnaik, H. C. Nagaraj, P. N. Hamsavath, and N. Nalini, Eds., Singapore: Springer, 2022, pp. 653–662. doi: 10.1007/978-981-16-1342-5_50.
- Y. Khodke and S. Deshpande, “Stock Price Prediction Using LSTM and GRU,” IJRASET, vol. 11, no. 6, pp. 1163–1167, Jun. 2023, doi: 10.22214/ijraset.2023.53826.
- M. J. Hamayel and A. Y. Owda, “A Novel Cryptocurrency Price Prediction Model Using GRU, LSTM and bi-LSTM Machine Learning Algorithms,” AI, vol. 2, no. 4, pp. 477–496, Oct. 2021, doi: 10.3390/ai2040030.
- F. Barez, P. Bilokon, A. Gervais, and N. Lisitsyn, “Exploring the Advantages of Transformers for High-Frequency Trading,” Feb. 20, 2023, arXiv: arXiv:2302.13850. doi: 10.48550/arXiv.2302.13850.
- X. Zhang, “Financial Time Series Forecasting Based on LSTM Neural Network optimized by Wavelet Denoising and Whale Optimization Algorithm,” AJCIS, vol. 5, no. 7, 2022, doi: 10.25236/ajcis.2022.050701.
- N. A. Hitam, A. R. Ismail, and F. Saeed, “An Optimized Support Vector Machine (SVM) based on Particle Swarm Optimization (PSO) for Cryptocurrency Forecasting,” Procedia Computer Science, vol. 163, pp. 427–433, Jan. 2019, doi: 10.1016/j.procs.2019.12.125.
- P. Deka, M. Cordeiro-Costas, R. Pérez-Orozco, M. Chabiński, and A. Szlęk, “Novel NSGA-II optimized LSTM and GRU models for short-term forecasting of residential heating load,” Energy and Buildings, vol. 344, p. 115999, Oct. 2025, doi: 10.1016/j.enbuild.2025.115999.
- W. Zhai, “Stock Price Prediction Based on Optimized LSTM Model,” in Proceedings of the 2nd International Conference on Financial Innovation, FinTech and Information Technology, FFIT 2023, July 7–9, 2023, Chongqing, China, EAI, 2023. doi: 10.4108/eai.7-7-2023.2338038.

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Copyright (c) 2025 Array