Enhancing Stock Market Forecasting with a Stacked LSTM Model Integrating Technical Indicators and Market Sentiment

Authors

  • David Baraka Makindu Department of Computer Science, School of Computing and Informatics, Maseno University, Kenya Author
  • Calvins Otieno Department of Computer Science, School of Computing and Informatics, Maseno University, Kenya Author
  • James Obuhuma Department of Computer Science, School of Computing and Informatics, Maseno University, Kenya Author

DOI:

https://doi.org/10.32628/CSEIT251117124

Keywords:

Stock Market Forecasting, Deep Learning, Long Short-Term Memory, Sentiment Analysis, FinBERT, Cross-Market Generalization

Abstract

Background: The accurate prediction of stock prices remains a significant challenge due to market volatility, non-linear patterns, and the influence of diverse factors like economic indicators and investor sentiment. Traditional models like ARIMA and shallow machine learning models often fail to capture these complexities. Methods: This study develops and evaluates a Stacked Long Short-Term Memory (LSTM) neural network model for stock market forecasting. The model integrates heterogeneous data sources, including technical indicators, macroeconomic variables, and sentiment scores derived from financial news headlines using FinBERT. The architecture employs two LSTM layers, dropout regularization, and Bayesian hyperparameter tuning. We trained the model on a diverse dataset of four major indices (S&P 500, NASDAQ, FTSE 100, Nikkei 225) from 2010 to 2024 and evaluated its performance in a zero-shot setting on the unseen Shanghai Stock Exchange (SSE) Composite index. Results: The proposed Stacked LSTM model significantly outperformed traditional benchmarks (ARIMA, GARCH, SVM). It achieved an R² of 0.956 and the lowest RMSE (105.18) on the test set. In the critical zero-shot cross-market evaluation on the SSE, the model demonstrated strong generalization with an R² of 0.93, whereas ARIMA and GARCH failed entirely (R² ≈ 0). The incremental addition of technical indicators and sentiment features progressively improved predictive accuracy, with sentiment reducing short-term prediction errors by approximately 15% during volatile periods. Conclusion: The results confirm that a deep Stacked LSTM architecture, enriched with multi- source features and robust regularization, provides a superior and generalizable framework for stock market forecasting, offering substantial improvements over conventional methods.

Downloads

Download data is not yet available.

References

Fischer, T., & Krauss, C. (2018). Deep learning with long short-term memory networks for financial market predictions. European Journal of Operational Research. DOI: https://doi.org/10.1016/j.ejor.2017.11.054

Bollerslev, T. (1986). Generalized autoregressive conditional heteroskedasticity. Journal of Econometrics. DOI: https://doi.org/10.1016/0304-4076(86)90063-1

Kim, K. J. (2003). Application of support vector machines to the prediction of KOSPI. Proc. of KISIS.

Li, A. W., & Bastos, G. S. (2020). Stock market forecasting using deep learning and technical analysis: a systematic review. IEEE Access. DOI: https://doi.org/10.1109/ACCESS.2020.3030226

Jiao, Y., & Jakubowicz, J. (2017). Predicting stock movement direction with machine learning: An extensive study on S&P 500 stocks. IEEE Big Data. DOI: https://doi.org/10.1109/BigData.2017.8258518

Zhang, M., et al. (2022). A survey on regularization techniques in deep learning. Information Fusion.

Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation. DOI: https://doi.org/10.1162/neco.1997.9.8.1735

Sunny, M. A. I., et al. (2020). Deep learning-based stock price prediction using LSTM and bi-directional LSTM model. NILES Conference.

Araci, D. (2019). FinBERT: A pretrained language model for financial communications. arXiv preprint arXiv:1908.10063.

Liu, Z. H., et al. (2024). A wavelet-LSTM model for short-term wind power forecasting. Expert Systems with Applications. DOI: https://doi.org/10.1016/j.eswa.2024.123237

Downloads

Published

20-10-2025

Issue

Section

Research Articles

How to Cite

[1]
David Baraka Makindu, Calvins Otieno, and James Obuhuma, “ Enhancing Stock Market Forecasting with a Stacked LSTM Model Integrating Technical Indicators and Market Sentiment ”, Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol, vol. 11, no. 5, pp. 212–215, Oct. 2025, doi: 10.32628/CSEIT251117124.