Impact of historical data horizon on the predictive and financial performance of LSTM neural networks

a case study with brazilian banking stocks

Authors

DOI:

https://doi.org/10.47236/2594-7036.2026.v10.2228

Keywords:

Algorithmic trading, Backtesting, Financial forecasting, LSTM, Time series

Abstract

This study investigated the impact of the historical data horizon on the performance of predictive models based on Long Short-Term Memory (LSTM) neural networks applied to the financial market. Five assets from the Brazilian banking sector were analyzed using daily data obtained through the Yahoo Finance library. The study compared two experimental configurations, using five and ten years of historical data, evaluated through chronological train-test splits. Predictive performance was assessed using regression metrics, including RMSE, MAE, MAPE, and R², while financial performance was evaluated through backtesting with different trading strategies and comparison against the Buy & Hold benchmark strategy. The results indicated that, for assets with complete historical records, the ten-year horizon was associated with better predictive performance in most of the evaluated metrics. However, the financial impact varied according to the asset and the trading strategy, indicating that better predictive adherence does not, by itself, guarantee higher operational returns. The study concludes that extending the historical data horizon may improve the generalization capability of LSTM models in the analyzed scenario, although the adopted experimental design does not allow isolating whether this effect is due only to the larger number of observations or also to the greater diversity of market regimes contained in the longer period.

Downloads

Download data is not yet available.

Metrics

Metrics Loading ...

Author Biographies

Caio Santos Silva, Federal University of Tocantins

Bachelor’s Degree in Computer Science from the Federal University of Tocantins. Palmas, Tocantins, Brazil. E-mail: caio.santos@uft.edu.br. ORCID: https://orcid.org/0009-0003-7000-6213. Lattes Curriculum: http://lattes.cnpq.br/6894608338552623.  

Rafael Lima de Carvalho, Federal University of Rio de Janeiro

Doctor in Systems and Computer Engineering from the Federal University of Rio de Janeiro. Professor in the Graduate Program in Governance and Digital Transformation at the Palmas Campus of the Federal University of Tocantins. Palmas, Tocantins, Brazil. E-mail: rafael.lima@uft.edu.br. ORCID: https://orcid.org/0000-0002-5296-8641. Lattes Curriculum: http://lattes.cnpq.br/0175648235036864.

References

AROUSSI, Ran. yfinance: Yahoo! finance market data downloader. Version 0.1.54, 2019. Disponível em: https://pypi.org/project/yfinance/. Acesso em: 10 abr. 2026.

BALAMOHAN, S. et al. Advancement of stock market forecasting with adamW and LSTM: a scalable deep learning system leveraging technical indicators. In: International Conference on Artificial Intelligence and Knowledge Discovery in Concurrent Engineering. IEEE, 2025. DOI: 10.1109/ICECONF65644.2025.11379417.

BOUSBAA, Z.; SANCHEZ-MEDINA, J.; BENCHAREF, O. Financial time series forecasting: a data stream mining-based system. Electronics, v. 12, n. 9, p. 2039, 2023. DOI: 10.3390/electronics12092039.

DIOUBI, F. et al. Enhancing stock market predictions via hybrid external trend and internal components analysis and long short term memory model. Journal of King Saud University - Computer and Information Sciences, v. 36, 2024. DOI: 10.1016/j.jksuci.2024.102252.

FISCHER, Thomas; KRAUSS, Christopher. Deep learning with long short-term memory networks for financial market predictions. European Journal of Operational Research, Amsterdam, v. 270, n. 2, p. 654-669, 2018. DOI: 10.1016/j.ejor.2017.11.054.

HOCHREITER, Sepp; SCHMIDHUBER, Jürgen. Long short-term memory. Neural

Computation, Cambridge, v. 9, n. 8, p. 1735-1780, 1997. DOI:

10.1162/neco.1997.9.8.1735.

KAHRA, D.; KAHRA, V. VSF-Net: A variational encoder and Sharpness-Aware attention framework for robust forecasting of non-stationary financial time series. International Journal of Information Technology, 2025. DOI: 10.1007/s41870-025-02933-y.

LAHBABI, H. et al. Stock price forecasting using ito-ADAM optimized long Short-Term memory neural networks. Statistics, Optimization and Information Computing, v. 14, p. 3282–3298, 2025. DOI: 10.19139/soic-2310-5070-2876.

LÓPEZ DE PRADO, Marcos. Advances in financial machine learning. Hoboken:

Wiley, 2018.

SHABE, R.; ENGELBRECHT, A.; ANDERSON, K. Incremental reinforcement learning for portfolio optimisation. Computers, v. 14, n. 242, 2025. DOI: 10.3390/computers14070242.

TSAY, Ruey S. Analysis of financial time series. 2. ed. Hoboken: Wiley-Interscience, 2005.

ZANOTTO, Eduardo Luiz; HÖLBIG, Carlos Amaral. Previsão de preços de ações e ETF na bolsa de valores B3 aplicando técnicas de machine learning. Revista Sítio Novo, Palmas, v. 10, p. e1879, 2026. DOI: 10.47236/2594-7036.2026.v10.1879.

ZHANG, Cheng; SJARIF, Nilam Nur Amir; IBRAHIM, Roslina. Deep learning models for price forecasting of financial time series: a review of recent advancements: 2020–2022. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, v. 14, n. 1, e1519, 2024. DOI: 10.1002/widm.1519.

ZHANG, Guoqiang; PATUWO, B. Eddy; HU, Michael Y. Forecasting with artificial neural networks: the state of the art. International Journal of Forecasting, Amsterdam, v. 14, n. 1, p. 35-62, 1998. DOI: 10.1016/S0169-2070(97)00044-7.

Published

2026-08-24

How to Cite

SILVA, Caio Santos; CARVALHO, Rafael Lima de. Impact of historical data horizon on the predictive and financial performance of LSTM neural networks: a case study with brazilian banking stocks. Sítio Novo Magazine, Palmas, v. 10, p. e2228, 2026. DOI: 10.47236/2594-7036.2026.v10.2228. Disponível em: https://sitionovo.ifto.edu.br/index.php/sitionovo/article/view/2228. Acesso em: 27 aug. 2026.

Issue

Section

Artigo Científico