A Dual-Layer LSTM Stock Prediction Model Integrating Multi-Factor Attributes
DOI: https://doi.org/10.62517/jse.202511610
Author(s)
Gesen Xu
Affiliation(s)
Information and Computational Science, Guangdong University of Technology (Longdong Campus), Guangzhou, Guangdong, China,
Abstract
Stock price forecasting is a vital task in financial time series analysis. Traditional linear models (e.g., ARIMA, VAR, LASSO) fail to capture long-term dependencies and nonlinearities, while tree-based methods such as XGBoost depend heavily on feature engineering. This study proposes a dual-layer LSTM framework with differenced targets, Dropout regularisation, Huber loss, and adaptive optimisation strategies. Daily data of SPDB (2018–2024) are split into training, validation, and testing sets (70/10/20). Financial indicators are aligned with market data using carry-forward methods, and 12 high-quality factors are selected via IC analysis. The model is benchmarked against ARIMA, ARIMAX, XGBoost, and Transformer, evaluated by MAE, MSE, RMSE, and R². On the test set, the dual-layer LSTM achieves superior performance (MAE=0.0972, RMSE=0.1455, R²=0.9848). Robustness and ablation analyses confirm that its deep architecture, resilient loss function, and factor integration collectively enhance accuracy, convergence, and stability, demonstrating its effectiveness in modelling complex financial time series.
Keywords
Stock Price Prediction; Machine Learning; Deep Learning; Long Short-Term Memory (LSTM); Financial Time Series
References
[1] Shumway, R. H., & Stoffer, D. S. (2017). ARIMA models. In Time series analysis and its applications. Springer Texts in Statistics. Springer, Cham. https://doi.org/10.1007/978-3-319-52452-8_3
[2] Canova, F. (1995). The economics of VAR models. In K. D. Hoover (Ed.), Macroeconometrics (pp. 31–65). Recent Economic Thought Series, vol 46. Springer, Dordrecht. https://doi.org/10.1007/978-94-011-0669-6_3
[3] Tibshirani, R. (1996). Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society: Series B (Methodological), 58(1), 267–288.
[4] Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp. 785–794). ACM. https://doi.org/10.1145/2939672.2939785
[5] Nelson, D. M. Q., Pereira, A. C. M., & de Oliveira, R. A. (2017). Stock market’s price movement prediction with LSTM neural networks. In 2017 International Joint Conference on Neural Networks (IJCNN) (pp. 1419–1426). IEEE. https://doi.org/10.1109/IJCNN.2017.7966019
[6] Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735–1780. https://doi.org/10.1162/neco.1997.9.8.1735
[7] 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. https://doi.org/10.1016/j.ejor.2017.11.054
[8] Zhou, H., Zhang, S., Peng, J., Zhang, S., Li, J., Xiong, H., & Zhang, W. (2021). Informer: Beyond efficient transformer for long sequence time-series forecasting. Proceedings of the AAAI Conference on Artificial Intelligence, 35(12), 11106–11115. https://doi.org/10.1609/aaai.v35i12.17325
[9] Li, S., & Xu, S. (2025). Enhancing stock price prediction using GANs and transformer-based attention mechanisms. Empirical Economics, 68(1), 373–403. https://doi.org/10.1007/s00181-024-02644-6
[10] Bhandari, H. N., Rimal, B., Pokhrel, N. R., Rimal, R., Dahal, K. R., & Khatri, R. K. C. (2022). Predicting stock market index using LSTM. Machine Learning with Applications, 9, 100320. https://doi.org/10.1016/j.mlwa.2022.100320
[11] Wu, J. M.-T., Li, Z., Herencsar, N., Vo, B., & Lin, J. C.-W. (2023). A graph-based CNN-LSTM stock price prediction algorithm with leading indicators. Multimedia Systems, 29, 1751–1770. https://doi.org/10.1007/s00530-021-00758-w
[12] Ariyo, A. A., Adewumi, A. O., & Ayo, C. K. (2014). Stock price prediction using the ARIMA model. In 2014 UKSim-AMSS 16th International Conference on Computer Modelling and Simulation (pp. 106–112). IEEE. https://doi.org/10.1109/UKSim.2014.67
[13] Wang, Y., & Guo, Y. (2020). Forecasting method of stock market volatility in time series data based on mixed model of ARIMA and XGBoost. China Communications, 17(3), 205–221. https://doi.org/10.23919/JCC.2020.03.017
[14] Zhang, Q., Qin, C., Zhang, Y., Bao, F., Zhang, C., & Liu, P. (2022). Transformer-based attention network for stock movement prediction. Expert Systems with Applications, 202, 117239. https://doi.org/10.1016/j.eswa.2022.117239
[15] J.H. Ruan, K. Wang, T.Y. Feng, et al. (2025). Stock prediction methods based on Transformer. Computer and Digital Engineering, 53(5), 1375–1380, 1433.
[16] X. Yang. (2024). Stock price prediction based on an improved Transformer model (Master’s thesis, Jiangxi University of Finance and Economics). https://doi.org/10.27175/d.cnki.gjxcu.2024.000530
[17] W.D. He, G. He, & Y. Zhou. (2025). Stock price prediction based on a TPE-Informer-LSTM hybrid framework. Journal of Chongqing Technology and Business University (Natural Science Edition), 1–9. https://link.cnki.net/urlid/50.1155.N.20250703.1553.006
[18] S.C. Liu. (2025). Analysis of stock price prediction methods based on the LSTM machine learning model (Master’s thesis, Hangzhou Dianzi University). https://doi.org/10.27075/d.cnki.ghzdc.2025.000075
[19] R.Q. Sun. (2016). Research on a price-trend prediction model of U.S. stock indices based on LSTM neural networks (Master’s thesis, Capital University of Economics and Business).
[20] Y. Peng , Y.H. Liu, & R.F. Zhang. (2019). Modeling and analysis of stock price prediction based on LSTM. Computer Engineering and Applications, 55(11), 209–212.