Application of Deep Learning for Stock Prediction Within the Framework of Portfolio Optimization in Quantitative Trading
Downloads
This paper proposes a method for stock prediction and portfolio optimization as a part of quantitative trading based on a combination of Bi-RNN and a modified snake optimization algorithm (MSOA) to build optimal portfolios and outperform conventional models and benchmarks. Methods/Analysis: We employ the Bi-RNN model, which processes historical stock data in both forward and backward directions to unveil intricate temporal dependencies. MSOA is used to fine-tune the hyperparameters of the Bi-RNN with enhancements such as Latin Hypercube Sampling for initialization, dynamic temperature adjustment, adaptive learning rates, and hybrid exploration-exploitation mechanisms. The Markowitz mean-variance approach is used to optimize the portfolio from asset allocations that the MSOA then improves. The model is evaluated on the S&P 500 from 1993 to 2020. Results: Such findings in experiments indicate that the proposed model outperforms baseline models, e.g., LSTM, GRU, and HMM, with lower Mean Squared Percentage Error (MSPE) values and higher Sharpe ratios of constructed portfolios. For instance, Portfolio 3 produced a 10.9% expected return with a standard deviation of 12.9%, delivering risk-adjusted returns that exceed those of the S&P 500. Novelty/Improvement: A strong integrated approach of deep learning and advanced optimization techniques is proposed for stock prediction and portfolio optimization, which achieves notable improvements in terms of accuracy and efficiency. The proposed approach overcomes the drawbacks of traditional algorithms, making it a valuable tool for financial decision-making.
Downloads
[1] Thio-Ac, A. C., Cabrales, D. D., Calibara, D. E., Madrazo, M. V., Matawaran, A. C. C., Micaller, G. E., Fernandez, E. O., Amado, T. M., Jorda, R. L., Tolentino, L. K. S., & Enriquez, L. A. C. (2023). Stock Price Prediction and Portfolio Optimization Using Hidden Markov Model and Quadratic Programming. International Conference on Integrated Intelligence and Communication Systems, ICIICS 2023, 1–7. doi:10.1109/ICIICS59993.2023.10421179.
[2] Xiao, C., & Tang, F. (2023). Quantitative trading prediction model based on Long Short-Term Memory. ACM International Conference Proceeding Series, 692–696. doi:10.1145/3650215.3650336.
[3] Martínez-Barbero, X., Cervelló-Royo, R., & Ribal, J. (2025). Portfolio Optimization with Prediction-Based Return Using Long Short-Term Memory Neural Networks: Testing on Upward and Downward European Markets. Computational Economics, 65(3), 1479–1504. doi:10.1007/s10614-024-10604-6.
[4] Huang, X., Wu, C., Du, X., Wang, H., & Ye, M. (2024). A novel stock trading utilizing long short-term memory prediction and evolutionary operating-weights strategy. Expert Systems with Applications, 246, 123146. doi:10.1016/j.eswa.2024.123146.
[5] Jeribi, F., Martin, R. J., Mittal, R., Jari, H., Alhazmi, A. H., Malik, V., Swapna, S. L., Goyal, S. B., Kumar, M., & Singh, S. V. (2024). A Deep Learning Based Expert Framework for Portfolio Prediction and Forecasting. IEEE Access, 12, 103810–103829. doi:10.1109/ACCESS.2024.3434528.
[6] Houssein, E. H., Saad, M. R., Hashim, F. A., Shaban, H., & Hassaballah, M. (2020). Lévy flight distribution: A new metaheuristic algorithm for solving engineering optimization problems. Engineering Applications of Artificial Intelligence, 94, 103731. doi:10.1016/j.engappai.2020.103731.
[7] Samareh Moosavi, S. H., & Bardsiri, V. K. (2019). Poor and rich optimization algorithm: A new human-based and multi populations algorithm. Engineering Applications of Artificial Intelligence, 86, 165–181. doi:10.1016/j.engappai.2019.08.025.
[8] Ayyarao, T. S. L. V., Ramakrishna, N. S. S., Elavarasan, R. M., Polumahanthi, N., Rambabu, M., Saini, G., Khan, B., & Alatas, B. (2022). War Strategy Optimization Algorithm: A New Effective Metaheuristic Algorithm for Global Optimization. IEEE Access, 10, 25073–25105. doi:10.1109/ACCESS.2022.3153493.
[9] Anita, & Yadav, A. (2019). AEFA: Artificial electric field algorithm for global optimization. Swarm and Evolutionary Computation, 48, 93–108. doi:10.1016/j.swevo.2019.03.013.
[10] Razmjooy, N., Deshpande, A., Khalilpour, M., Estrela, V. V., Padilha, R., & Monteiro, A. C. B. (2021). Optimal Bidding Strategy for Power Market Based on Improved World Cup Optimization Algorithm. Lecture Notes in Electrical Engineering, 696, 137–152. doi:10.1007/978-3-030-56689-0_7.
[11] Wang, J., Hong, S., Dong, Y., Li, Z., & Hu, J. (2024). Predicting Stock Market Trends Using LSTM Networks: Overcoming RNN Limitations for Improved Financial Forecasting. Journal of Computer Science and Software Applications, 4(3), 1–7.
[12] Maseleno, A., Huda, M., & Ratanamahatana, C. A. (2024). An explainable deep learning approach for classifying monkeypox disease by leveraging skin lesion image data. Emerging Science Journal, 8(5), 1875-1897. doi:10.28991/ESJ-2024-08-05-013.
[13] Khorram, A., Khalooei, M., & Rezghi, M. (2021). End-to-end CNN+ LSTM deep learning approach for bearing fault diagnosis. Applied Intelligence, 51(2), 736-751. doi:10.1007/s10489-020-01859-1.
[14] Luo, J., & Zhang, X. (2022). Convolutional neural network based on attention mechanism and Bi-LSTM for bearing remaining life prediction. Applied Intelligence, 52(1), 1076-1091. doi:10.1007/s10489-021-02503-2.
[15] Utama, W., Hermana, M., Warnana, D. D., Lestari, W., Zakariah, M. N. A., Garini, S. A., … Abdul Latiff, A. H. (2025). Enhancing Magnetotelluric Data Quality Using Deep Learning-Based Denoising Models: A Study of CNN and LSTM. Journal of Human, Earth, and Future, 6(2), 399–425. doi:10.28991/HEF-2025-06-02-010.
[16] Xue, X., Gao, Y., Liu, M., Sun, X., Zhang, W., & Feng, J. (2021). GRU-based capsule network with an improved loss for personnel performance prediction. Applied Intelligence, 51(7), 4730-4743. doi:10.1007/s10489-020-02039-x.
[17] Yang, H., & Liu, S. (2022). Water quality prediction in sea cucumber farming based on a GRU neural network optimized by an improved whale optimization algorithm. PeerJ Computer Science, 8, e1000. doi:10.7717/peerj-cs.1000.
[18] Narayana, S., Sri, S. N. D., Kumar, S. R., Ajay, T., & Vasiq, S. S. (2024). Predicting the stock market index using GRU for the year 2020. ESIC 2024 - 4th International Conference on Emerging Systems and Intelligent Computing, Proceedings, 399–404. doi:10.1109/ESIC60604.2024.10481534.
- This work (including HTML and PDF Files) is licensed under a Creative Commons Attribution 4.0 International License.
