Stock Price Forecasting Using a Time-Series Long Short-Term Memory Model
DOI:
https://doi.org/10.37075/FABA.2025.2.13Keywords:
Stock price, LSTM, Prediction accuracy, Python-based implementationAbstract
Purpose: This study aims to introduce and evaluate a novel application of Long Short-Term Memory (LSTM) networks for stock price forecasting by integrating multi-stock comparative analysis across different volatility regimes, addressing a key gap in the literature regarding model robustness and generalizability.
Design/Methodology/Approach: Using a time-series covering 2019–2023, the study implements an LSTM model within a Python-based framework. The model is trained on data from 01/01/2022 to 12/31/2023 and tested on 01/01/2019 to 12/31/2021. Mean squared error is employed as the primary evaluation metric to assess forecasting accuracy across heterogeneous stocks.
Findings: Empirical results show that the LSTM model effectively captures complex temporal dependencies and nonlinear patterns in financial time series, producing reliable stock price forecasts. It outperforms conventional time-series benchmarks and demonstrates strong adaptability across stocks with differing volatility characteristics.
Practical Implications: For investors, LSTM-based forecasts provide deeper insights into risk–return dynamics and support more informed, data-driven investment strategies. For policymakers, the results highlight the increasing importance of machine learning tools in enhancing transparency, stability, and efficiency in financial markets.
Originality/Value: The study offers a unique contribution by demonstrating that a unified LSTM framework can generalize across multiple stocks and volatility regimes, establishing both its theoretical relevance and practical utility in algorithmic trading and financial forecasting.
Downloads
References
Adrian, T., and N. Liang. 2018. Monetary policy, financial conditions, and financial stability. International Journal of Central Banking, 14(1): 73–131.
Baker, M., and J. Wurgler. 2007. Investor sentiment in the stock market. Journal of Economic Perspectives, 21(2): 129–151. https://doi.org/10.1257/jep.21.2.129
Baker, S. R., N. Bloom, S. J. Davis, and S. J. Terry. 2022. COVID-induced economic uncertainty and its impact on financial markets. Review of Asset Pricing Studies, 12(1), 1–38. https://doi.org/10.3386/w26983
Barbosa, N., and R. de Oliveira, R. 2020. Financialization and innovation: Evidence from the U.S. tech sector. Technological Forecasting and Social Change, 161: 120254. https://doi.org/10.1016/j.techfore.2020.120254
Blinder, A. S., M. Ehrmann, M. Fratzscher, J. de Haan, and D. J. Jansen. 2008. Central bank communication and monetary policy. Journal of Economic Literature, 46(4): 910–945. https://doi.org/10.1257/jel.46.4.910
Borio, C. 2014. The financial cycle and macroeconomics: What have we learnt? Journal of Banking & Finance, 45: 182–198. https://doi.org/10.1016/j.jbankfin.2013.07.031
Chen, Y., T. Chen, X. Wang, J. Li. 2020. Stock price prediction using deep learning models. Expert Systems with Applications, 159: 113538. https://doi.org/10.1016/j.eswa.2020.113538
Das, N., B. Goswami, and R. N. A. Begum. 2023. Stock prices prediction using long short-term memory. In Proceedings of the 4th International Conference on Computing and Communication Systems (I3CS) (pp. 1–5). https://doi.org/10.1109/I3CS58314.2023.10127443
Fama, E. F. 1970. Efficient capital markets: A review of theory and empirical work. Journal of Finance, 25(2): 383–417. https://doi.org/10.1111/j.1540-6261.1970.tb00518.x
Fama, E. F., and K. R. French. 2015. A five-factor asset pricing model. Journal of Financial Economics, 116(1): 1–22. https://doi.org/10.1016/j.jfineco.2014.10.010
Fischer, T., and C. Krauss. 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
Goswami, D. K. 2023. Predicting the stock price/movements of companies listed under BSEIT
Goyal, A. 2004. Demographics, stock market flows, and stock returns. Journal of Financial and Quantitative Analysis, 39(1): 115–142. https://doi.org/10.1017/S0022109000003980
Hochreiter, S. 1997. Long short-term memory. Neural Computation, 9(8): 1735–1780. https://doi.org/10.1162/neco.1997.9.8.1735
Hochreiter, S., and J. Schmidhuber. 1997. Flat minima. Neural Computation, 9(1): 1–42. https://doi.org/10.1162/neco.1997.9.1.1
Jain, K. 2017. Gods in the time of automobility. Current Anthropology, 58(S15): S13–S26. https://doi.org/10.1086/688544
Joosery, B., and G. Deepa. 2019. Comparative analysis of time-series forecasting algorithms for stock price prediction. Advanced Information Science and System Conference Proceedings, 1–6. https://doi.org/10.1145/3373477.3373699
Liao, Y., J. Wang, L. Liao, X. Shu, and T. Peng. 2024. Policy synergy on stock price crash risk: An intergovernmental perspective. https://doi.org/10.1016/j.frl.2024.105744
Lim, S., S. J. Kim, Y. Park, and N. Kwon. 2021. A deep learning-based time series model with missing value handling techniques to predict various types of liquid cargo traffic. Expert Systems with Applications, 184: 115532.
Kumar, S. K., B. Meher, R. Birau, M. Simion, I. Florescu, A. Anand, and S. Kumar. 2023. Long-term volatility forecasting of Brazilian stock index behavior. Revista de Stiinte Politice, 79: 9–24. https://doi.org/10.1016/j.eswa.2021.115532
Lo, A. W. 2004. The adaptive markets hypothesis. Journal of Portfolio Management, 30(5): 15–29. https://doi.org/10.3905/jpm.2004.412486
Lupton, N. C., V. Baulkaran, and Y. No. 2022. Subsidiary staffing, location choice, and shareholder rights effectiveness. Journal of Business Research, 151: 222–231. https://doi.org/10.1016/j.jbusres.2022.06.019
Makridakis, S., E. Spiliotis, and V. Assimakopoulos. 2018. Statistical and machine learning forecasting methods. PLOS ONE, 13(3): e0194889. https://doi.org/10.1371/journal.pone.0194889
Nelson, C. R., and C. I. Plosser. 1982. Trends and random walks in macroeconomic time series. Journal of Monetary Economics, 10(2): 139–152. https://doi.org/10.1016/0304-3932(82)90012-5
Nelson, D. M. Q., A. C. M. Pereira, and R. A. de Oliveira. 2017. Stock market price movement prediction with LSTM neural networks. In Proceedings of the International Joint Conference on Neural Networks (IJCNN) (pp. 1419–1426). https://doi.org/10.1109/IJCNN.2017.7966019
Nguyen, H. T., A. N. N. Le, Q. T. Luu, N. T. T. Nguyen, and K. D. Duong. 2023. Foreign ownership, investor attention and the risk-taking behavior of property and casualty insurance firms: evidence from Vietnam. Sage Open, 13(4): 21582440231211971. https://doi.org/10.1177/21582440231211971
Nurazi, R., and B. Usman. 2016. Bank stock returns in responding the contribution of fundamental and macroeconomic effects. Journal of Economics and Policy, 9(1): 134-149.
Ouyang, Z., X. Wang, and Y. Liu. 2024. The use of corporate social responsibility in response to product‐harm crisis: How do stock market reactions matter?. Corporate Social Responsibility and Environmental Management, 31(4): 3081-3097. https://doi.org/10.1002/csr.2739
Ouyang, Z. 2022, March. A Study of Stock Portfolio Strategy Based on Machine Learning. In 2022 7th International Conference on Financial Innovation and Economic Development (ICFIED 2022) (pp. 79-87). Atlantis Press. https://doi.org/10.2991/aebmr.k.220307.013
Shao, H., and B.-H. Soong. 2016. Traffic flow prediction with long short-term memory networks. In TENCON 2016 – IEEE Region 10 Conference (pp. 2986–2989). https://doi.org/10.1109/TENCON.2016.7848588
Shiller, R. J. 2003. From efficient markets theory to behavioral finance. Journal of Economic Perspectives, 17(1): 83–104. https://doi.org/10.1257/089533003321164967
Teece, D. J., G. Pisano, and A. Shuen. 1997. Dynamic capabilities and strategic management. Strategic Management Journal, 18(7): 509–533. https://doi.org/10.1002/(SICI)1097-0266(199708)18:7<509::AID-SMJ882>3.0.CO;2-Z
Wang, Y., and X. Li. 2021. Forecasting stock price trends with deep learning. Applied Soft Computing, 108: 107443. https://doi.org/10.1016/j.asoc.2021.107443
Wang, Y., Y. Wei, C. Wu, and L. Yin. 2018. Oil and the short-term predictability of stock return volatility. Journal of Empirical Finance, 47: 90–104. https://doi.org/10.1016/j.jempfin.2018.04.008
Zaremba, A., R. Kizys, and D. Aharon. 2020. COVID-19 and global financial markets. Finance Research Letters, 35: 101508. https://doi.org/10.1016/j.frl.2020.101508
Zeng, Y., and X. Liu. 2018. A-stock price fluctuation forecast model based on LSTM. In Proceedings of the 14th International Conference on Semantics, Knowledge and Grids (SKG) (pp. 261–264). https://doi.org/10.1109/SKG.2018.00043
Zhang, G., B. E. Patuwo, and M. Y. Hu. 2020. Forecasting with artificial neural networks. International Journal of Forecasting, 36(1): 1–26. https://doi.org/10.1016/j.ijforecast.2019.07.001
Zhang, Y., and X. Zhang. 2021. The role of product innovation in stock market performance. Technovation, 106: 102292. https://doi.org/10.1016/j.technovation.2021.102292
Zou, J., H. Cao, L. Liu, Y. Lin, E. Abbasnejad, and J. Shi. 2022. Astock: A new dataset and automated stock trading model. arXiv Preprint arXiv:2206.06606. https://doi.org/10.48550/arXiv.2206.06606









