Optimized LSTM with TSCV for Forecasting Indonesian Bank Stocks

Authors

  • Rizka Mars Salsabila Universitas Dian Nuswantoro
  • Amiq Fahmi Universitas Dian Nuswantoro
  • Farrikh Al Zami Universitas Dian Nuswantoro

DOI:

https://doi.org/10.30871/jaic.v9i6.11314

Keywords:

Hyperparameter Optimization, OHLCV, Long Short-Term Memory, Time Series Cross-Validation, Volatility

Abstract

Volatility in financial markets presents complex forecasting challenges for investors, particularly within emerging economies such as Indonesia. This study proposes an optimized Long Short-Term Memory (LSTM) model for forecasting the stock prices of five significant Indonesian banks: BBCA, BBRI, BMRI, BBNI, and BBTN, utilizing daily OHLCV data (Open, High, Low, Close, Volume) and technical indicators from 2020 to 2025. The dataset comprises over 6,000 daily records, segmented using a sliding window approach to preserve temporal structure and enhance learning efficiency. Concurrently, the model architecture comprising dual LSTM layers with dropout regularization was refined through systematic hyperparameter tuning to enhance predictive performance. Model evaluation employed 5-fold Time Series Cross-Validation (TSCV), a sequential validation technique that mitigates data leakage and explicitly overcomes the limitations of conventional k-fold methods by preserving chronological integrity. Performance metrics included MSE, RMSE, MAE, R², and MAPE. The experiment results demonstrate the model’s robustness in capturing long-term dependencies within financial time series. BBCA and BMRI achieved superior accuracy (R² > 0.95), with BBCA recording the lowest MAPE of 2.34%. Despite market fluctuations, the model maintained consistent reliability across all test folds. This study overcomes a methodological limitation by integrating LSTM with TSCV in expanding markets, offering actionable insights for investors, analysts, and policymakers, and serving as a reference for adaptive AI-based, more informed forecasting tools. Moreover, the proposed framework holds promise for broader application across other financial sectors and regional markets with similar volatility characteristics.

Downloads

Download data is not yet available.

References

[1] B. Y. Dwiandiyanta, R. Hartanto, and R. Ferdiana, “Optimization of Stock Predictions on Indonesia Stock Exchange: A New Hybrid Deep Learning Method,” Engineering, Technology and Applied Science Research, vol. 15, no. 1, pp. 19370–19379, Feb. 2025, doi: 10.48084/etasr.9363.

[2] M. Azka Atqiya, L. Septem Riza, and A. Anisyah, “Stock Price Prediction Using the ETSFormer Model Case Study: PTBA,” vol. 5, no. 2, 2025, doi: 10.47709/brilliance.v5i2.6729.

[3] A. Y. Febriyanti, D. A. Prasetya, and T. Trimono, “Stock Price Prediction and Risk Estimation Using Hybrid CNN-LSTM and VaR-ECF,” Jurnal Teknik Informatika (Jutif), vol. 6, no. 3, pp. 1539–1554, 2025, doi: 10.52436/1.jutif.2025.6.3.4648.

[4] “Tren Investasi Saham di 2025: Apa yang Harus Dipertimbangkan Sebelum Berinvestasi ?” Accessed: Sep. 22, 2025. [Online]. Available: https://online.binus.ac.id/accounting/2025/04/17/tren-investasi-saham-di-2025-apa-yang-harus-dipertimbangkan-sebelum-berinvestasi/

[5] D. Satria, “Predicting Banking Stock Prices Using Rnn, Lstm, And GRU Approach,” Applied Computer Science, vol. 19, no. 1, pp. 82–94, 2023, doi: 10.35784/acs-2023-06.

[6] “Everything about LSTM and its working.” Accessed: Sep. 22, 2025. [Online]. Available: https://medium.com/@abhishekjainindore24/everything-about-lstm-and-its-working-f25f1cc30482

[7] W. Budiharto, “Data science approach to stock prices forecasting in Indonesia during Covid-19 using Long Short-Term Memory (LSTM),” J Big Data, vol. 8, no. 1, Dec. 2021, doi: 10.1186/s40537-021-00430-0.

[8] S. A. S. Purwandhani, A. A. N. Sajiatmoko, and C. S. K. Aditya, “Optimizing Indonesian Banking Stock Predictions with DBSCAN and LSTM,” Jurnal Teknik Informatika (Jutif), vol. 6, no. 3, pp. 1173–1188, 2025, doi: 10.52436/1.jutif.2025.6.3.4439.

[9] F. Santosa, E. Oktafanda, H. Setiawan, and A. Latif, “Advanced Long Short-Term Memory (LSTM) Models for Forecasting Indonesian Stock Prices,” Jurnal Galaksi, vol. 1, no. 3, pp. 198–208, 2024, doi: 10.70103/galaksi.v1i3.42.

[10] W. Li and K. L. E. Law, “Deep Learning Models for Time Series Forecasting: A Review,” 2024, Institute of Electrical and Electronics Engineers Inc. doi: 10.1109/ACCESS.2024.3422528.

[11] W. Hastomo, A. Satyo, B. Karno, N. Kalbuana, E. Nisfiani -4, and L. Etp -, “JEPIN (Jurnal Edukasi dan Penelitian Informatika) Optimasi Deep Learning untuk Prediksi Saham di Masa Pandemi Covid-19,” vol. 7, Aug. 2021, doi: 10.26418/jp.v7i2.47411.

[12] R. Gunawan Santosa, A. R. Chrismanto, and Y. Lukito, “Stocks Forecasting Exploration on Lq45 Index Using Arima (P,D,Q) Model,” J Theor Appl Inf Technol, vol. 15, no. 13, 2022, [Online]. Available: www.jatit.org

[13] B. Jange, “Prediksi Harga Saham Bank BCA Menggunakan XGBoost,” ARBITRASE: Journal of Economics and Accounting, vol. 3, no. 2, pp. 231–237, Nov. 2022, doi: 10.47065/arbitrase.v3i2.495.

[14] T. Purwa, U. Nafngiyana, and S. Suhartono, “Comparison of Arima, Transfer Function And Var Models For Forecasting Cpi, Stock Prices, And Indonesian Exchange Rate: Accuracy Vs. Explainability,” MEDIA STATISTIKA, vol. 13, no. 1, pp. 1–12, Jun. 2020, doi: 10.14710/medstat.13.1.1-12.

[15] E. P. Wahyuddin, R. E. Caraka, R. Kurniawan, W. Caesarendra, P. U. Gio, and B. Pardamean, “Improved LSTM hyperparameters alongside sentiment walk-forward validation for time series prediction,” Journal of Open Innovation: Technology, Market, and Complexity, vol. 11, no. 1, p. 100458, 2025, doi: 10.1016/j.joitmc.2024.100458.

[16] “How-To: Cross Validation with Time Series Data.” Accessed: Sep. 22, 2025. [Online]. Available: https://towardsdatascience.com/how-to-cross-validation-with-time-series-data-9802a06272c6/

[17] “Bursa Efek Jakarta & Indonesia | Pasar Keuangan Indonesia.” Accessed: Sep. 22, 2025. [Online]. Available: https://www.idnfinancials.com/id/

[18] A. Aldoseri, K. N. Al-Khalifa, and A. M. Hamouda, “Re-Thinking Data Strategy and Integration for Artificial Intelligence: Concepts, Opportunities, and Challenges,” Jun. 01, 2023, MDPI. doi: 10.3390/app13127082.

[19] “Data Pre-Processing with Sklearn using Standard and Minmax scaler.” Accessed: Sep. 22, 2025. [Online]. Available: https://www.geeksforgeeks.org/machine-learning/data-pre-processing-wit-sklearn-using-standard-and-minmax-scaler/

[20] W. Li, L. Zhang, and X. Zhang, “Predicting Multi-Indicator Stock Time Series using Convolutional Neural Networks based on Feature Engineering,” International Journal of Computers Communications & Control, vol. 20, no. 5, 2025, doi: 10.15837/ijccc.2025.5.6774.

[21] “Time Series Cross-Validation (tsCV).” Accessed: Sep. 22, 2025. [Online]. Available: https://schneppat.com/time-series-cross-validation_tscv.html

[22] V. Deswal, “Hyperparameter Tuning of the LSTM model for Stock Price Prediction,” International Journal of Intelligent Systems and Applications in Engineering, vol. 12, no. 4, pp. 705–712, 2024.

[23] B. Tanuwijaya et al., “A Novel Single Valued Neutrosophic Hesitant Fuzzy Time Series Model: Applications in Indonesian and Argentinian Stock Index Forecasting,” IEEE Access, vol. 8, pp. 60126–60141, 2020, doi: 10.1109/ACCESS.2020.2982825.

Downloads

Published

2025-12-08

How to Cite

[1]
R. M. Salsabila, A. Fahmi, and F. Al Zami, “Optimized LSTM with TSCV for Forecasting Indonesian Bank Stocks”, JAIC, vol. 9, no. 6, pp. 3575–3587, Dec. 2025.

Similar Articles

1 2 3 4 5 > >> 

You may also start an advanced similarity search for this article.