IDEAS home Printed from https://ideas.repec.org/a/jbh/ijsrcs/v11y2025i5id1736.html

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

Author

Listed:
  • David Baraka Makindu
  • Calvins Otieno
  • James Obuhuma

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.

Suggested Citation

  • David Baraka Makindu & Calvins Otieno & James Obuhuma, 2025. "Enhancing Stock Market Forecasting with a Stacked LSTM Model Integrating Technical Indicators and Market Sentiment," International Journal of Scientific Research in Computer Science, Engineering and Information Technology, International Journal of Scientific Research in Computer Science, Engineering and Information Technology, vol. 11(5), pages 212-215, October.
  • Handle: RePEc:jbh:ijsrcs:v11:y2025:i5:id:1736
    DOI: 10.32628/CSEIT251117124
    Note: Article URL: https://ijsrcseit.com/home/article/view/CSEIT251117124
    as

    Download full text from publisher

    File URL: https://ijsrcseit.com/home/article/view/CSEIT251117124
    File Function: Article URL
    Download Restriction: no

    File URL: https://ijsrcseit.com/home/article/download/CSEIT251117124/CSEIT251117124
    File Function: Full text
    Download Restriction: no

    File URL: https://libkey.io/10.32628/CSEIT251117124?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:jbh:ijsrcs:v11:y2025:i5:id:1736. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Pankaj Sharma (USA) (email available below). General contact details of provider: https://ijsrcseit.com/home .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.