Prediction of Indonesian Banking Stock Prices Using a Hybrid LSTM and XGBoost Model with Optuna Based Hyperparameter Optimization
DOI:
https://doi.org/10.52436/1.jutif.2026.7.3.5715Keywords:
Financial Time Series, LSTM, Optuna, Residual Learning, Stock Price Prediction, XGBoostAbstract
Stock price prediction is a critical task in investment decision-making, particularly in highly volatile financial markets such as the Indonesian banking sector. While Long Short-Term Memory (LSTM) networks are effective in modeling temporal dependencies, they often fail to capture nonlinear residual patterns in financial time-series data, and their performance is highly sensitive to hyperparameter selection. To address these limitations, this study proposes a residual learning–based hybrid LSTM–XGBoost framework optimized using Optuna for predicting stock prices of major Indonesian banking stocks, namely BBCA, BBNI, BBRI, and BMRI. LSTM is employed as the base learner to model log-return sequences, while XGBoost is used to learn nonlinear residual structures from LSTM predictions. Latent embeddings extracted from the LSTM are further refined using Principal Component Analysis (PCA) to reduce redundancy and improve generalization. Hyperparameters of the LSTM, PCA, XGBoost, and calibration components are jointly optimized using Optuna with a Tree-structured Parzen Estimator (TPE) strategy. Experimental results demonstrate that the Optuna-optimized hybrid model consistently outperforms the baseline hybrid model across all datasets, achieving lower Mean Absolute Percentage Error (MAPE) values of 1.196% for BBCA, 1.67% for BBNI, 1.53% for BBRI, and 1.70% for BMRI. Additional stability analyses confirm that the proposed framework delivers stable and reliable predictions on unseen data. These findings provide a scalable hybrid forecasting framework that contributes to the development of intelligent financial decision-support systems and demonstrates the effectiveness of adaptive hybrid deep learning optimization techniques in real-world time-series prediction problems within the field of informatics.
Downloads
References
shyam sundar J, bijesh dhyani, and prashant chhajer, “Factors Affecting Stock Market Movements: An Investors Perspective.,” European Economic Letters, 2023, doi: 10.52783/eel.v13i1.172.
A. T. Haryono, R. Sarno, and K. R. Sungkono, “Stock price forecasting in Indonesia stock exchange using deep learning: a comparative study,” International Journal of Electrical and Computer Engineering (IJECE), vol. 14, no. 1, p. 861, Feb. 2024, doi: 10.11591/ijece.v14i1.pp861-869.
P. Prihatiningsih, E. D. Soemarso, M. Muslikh, M. A. Kodir, and M. R. Makom, “STRATEGI INVESTASI SAHAM PERBANKAN DENGAN PENDEKATAN TOP DOWN ANALYSIS,” Jurnal Aktual Akuntansi Keuangan Bisnis Terapan (AKUNBISNIS), vol. 6, no. 1, p. 71, Jun. 2023, doi: 10.32497/akunbisnis.v6i1.4580.
Z. Pangestika and B. P. Josaphat, “Predicting Stock Price Using Convolutional Neural Network and Long Short Term Memory (Case Study: Stock of BBCA),” Journal of the Indonesian Mathematical Society, vol. 31, no. 1, p. 1512, Mar. 2025, doi: 10.22342/jims.v31i1.1512.
I. W. Suarjana and I. A. Surasmi, “Forming an Optimal Portfolio with a Single Index Model: Empirical study on banking stocks in the LQ45 Index,” Jurnal Ekonomi dan Bisnis Jagaditha, vol. 11, no. 1, pp. 88–95, Mar. 2024, doi: 10.22225/jj.11.1.2024.88-95.
H. Mo, “Comparative Analysis of Linear Regression, Polynomial Regression, and ARIMA Model for Short-term Stock Price Forecasting,” Advances in Economics, Management and Political Sciences, vol. 49, no. 1, pp. 166–175, Dec. 2023, doi: 10.54254/2754-1169/49/20230509.
S. Rani, R. Kaur, and C. Desai, “ENHANCING TIME SERIES FORECASTING ACCURACY WITH DEEP LEARNING MODELS: A COMPARATIVE STUDY,” Int. J. Adv. Res. (Indore)., vol. 12, no. 08, pp. 315–324, Aug. 2024, doi: 10.21474/IJAR01/19257.
J. A. Putri, S. Suhartono, H. Prabowo, N. A. Salehah, D. D. Prastyo, and S. Setiawan, “Forecasting Currency in East Java: Classical Time Series vs. Machine Learning,” Indonesian Journal of Statistics and Its Applications, vol. 5, no. 2, pp. 284–303, Jun. 2021, doi: 10.29244/ijsa.v5i2p284-303.
S. Zhang, “Stock price prediction based on the long short-term memory network,” Applied and Computational Engineering, vol. 18, no. 1, pp. 28–32, Oct. 2023, doi: 10.54254/2755-2721/18/20230958.
S. Hanifi, A. Cammarono, and H. Zare-Behtash, “Advanced hyperparameter optimization of deep learning models for wind power prediction,” Renewable Energy, vol. 221, p. 119700, Feb. 2024, doi: 10.1016/j.renene.2023.119700.
Saumendra Mohanty, “An International Study of Application of Long Short-Term Memory (LSTM) Neural Networks for the prediction of stock and forex markets,” International Journal For Multidisciplinary Research, vol. 5, no. 3, May 2023, doi: 10.36948/ijfmr.2023.v05i03.3345.
R. M. Salsabila, A. Fahmi, and F. Al Zami, “Optimized LSTM with TSCV for Forecasting Indonesian Bank Stocks,” Journal of Applied Informatics and Computing, vol. 9, no. 6, pp. 3575–3587, Dec. 2025, doi: 10.30871/jaic.v9i6.11314.
P. Venkatasubbu, K. Verma, and D. E. Martina Jaincy, “A Hybrid Deep Learning and Ensemble Framework for Smart Grid Load Forecasting Using GRU and XGBoost,” in 2025 International Conference on Sensors and Related Networks (SENNET) Special Focus on Digital Healthcare(64220), IEEE, Jul. 2025, pp. 1–6. doi: 10.1109/SENNET64220.2025.11136089.
Y. , L. H. , & W. J. Zhao, “A Novel Residual Correction Approach Based on a Hybrid GARCH and XGBoost Model,” Academic Journal of Computing & Information Science, vol. 7, no. 11, 2024, doi: 10.25236/AJCIS.2024.071117.
R. U. Din, S. Ahmed, S. H. Khan, A. Albanyan, J. Hoxha, and B. Alkhamees, “A novel decision ensemble framework: Attention-customized BiLSTM and XGBoost for speculative stock price forecasting,” PLoS One, vol. 20, no. 4, p. e0320089, Apr. 2025, doi: 10.1371/journal.pone.0320089.
Y. Li and Y. Pan, “A novel ensemble deep learning model for stock prediction based on stock prices and news,” International Journal of Data Science and Analytics, vol. 13, no. 2, pp. 139–149, Mar. 2022, doi: 10.1007/s41060-021-00279-9.
H. Kadiri, H. Oukhouya, and K. Belkhoutout, “A comparative study of hybrid and individual models for predicting the Moroccan MASI index: Integrating machine learning and deep learning approaches,” Scientific African., vol. 28, p. e02671, Jun. 2025, doi: 10.1016/j.sciaf.2025.e02671.
L. Liang, “ARIMA with Attention-based CNN-LSTM and XGBoost hybrid model for stock prediction in the US stock market,” SHS Web of Conferences, vol. 196, p. 02001, 2024, doi: 10.1051/shsconf/202419602001.
F. Dakheel and M. Çevik, “Optimizing Smart Grid Load Forecasting via a Hybrid Long Short-Term Memory-XGBoost Framework: Enhancing Accuracy, Robustness, and Energy Management,” Energies (Basel)., vol. 18, no. 11, p. 2842, May 2025, doi: 10.3390/en18112842.
T. Liwei, F. Li, S. Yu, and G. Yuankai, “Forecast of LSTM-XGBoost in Stock Price Based on Bayesian Optimization,” Intelligent Automation & Soft Computing, vol. 29, no. 3, pp. 855–868, 2021, doi: 10.32604/iasc.2021.016805.
R. Nichani, L. Gasmi, N. Laiche, and S. Kabou, “Optimizing financial time series predictions with hybrid ARIMA, LSTM, and XGBoost Models,” STUDIES IN ENGINEERING AND EXACT SCIENCES, vol. 5, no. 2, p. e11188, Nov. 2024, doi: 10.54021/seesv5n2-582.
R. Garine, “Enhanced E-Commerce Demand Prediction through Ensemble Models and Optuna-Based Hyperparameter Optimization,” in 2024 2nd DMIHER International Conference on Artificial Intelligence in Healthcare, Education and Industry (IDICAIEI), IEEE, Nov. 2024, pp. 1–7. doi: 10.1109/IDICAIEI61867.2024.10842873.
Y. Cai, J. Feng, Y. Wang, Y. Ding, Y. Hu, and H. Fang, “The Optuna–LightGBM–XGBoost Model: A Novel Approach for Estimating Carbon Emissions Based on the Electricity–Carbon Nexus,” Applied Sciences, vol. 14, no. 11, p. 4632, May 2024, doi: 10.3390/app14114632.
P. Srinivas and R. Katarya, “hyOPTXg: OPTUNA hyper-parameter optimization framework for predicting cardiovascular disease using XGBoost,” Biomed. Signal Process. Control, vol. 73, p. 103456, Mar. 2022, doi: 10.1016/j.bspc.2021.103456.
S. P. Toufighi, A. M. Khani, A. Rezasoltani, I. G. Sahebi, and J. Vang, “Forecasting stock market anomalies in emerging markets: An OPTUNA-optimized isolation forest and K-means approach,” Machine Learning with Applications, vol. 22, p. 100770, Dec. 2025, doi: 10.1016/j.mlwa.2025.100770.
S. Lim, S. J. Kim, Y. Park, and N. Kwon, “A deep learning-based time series model with missing value handling techniques to predict various types of liquid cargo traffic,” Expert Systems with Applications, vol. 184, p. 115532, Dec. 2021, doi: 10.1016/j.eswa.2021.115532.
G. Taneva-Angelova and D. Granchev, “Deep Learning and Transformer Architectures for Volatility Forecasting: Evidence from U.S. Equity Indices,” Journal of Risk and Financial Management, vol. 18, no. 12, p. 685, Dec. 2025, doi: 10.3390/jrfm18120685.
J. W. Wilder, New concepts in technical trading systems, [1a. ed. española]. Greensboro/N. C.: Greensboro, N.C. : Trend Research, 1978. Accessed: Feb. 05, 2026. [Online]. Available: https://www.scribd.com/doc/314256186/Welles-Wilder-1#page=2
S. M. Mostafavi and A. R. Hooman, “Key technical indicators for stock market prediction,” Machine Learning with Applications, vol. 20, p. 100631, Jun. 2025, doi: 10.1016/j.mlwa.2025.100631.
A. Antonio Agudelo Aguirre, R. Alfredo Rojas Medina, and N. Darío Duque Méndez, “Machine learning applied in the stock market through the Moving Average Convergence Divergence (MACD) indicator,” Investment Management and Financial Innovations, vol. 17, no. 4, pp. 44–60, Nov. 2020, doi: 10.21511/imfi.17(4).2020.05.
Y.-S. Kim, M. K. Kim, N. Fu, J. Liu, J. Wang, and J. Srebric, “Investigating the impact of data normalization methods on predicting electricity consumption in a building using different artificial neural network models,” Sustain. Cities Soc., vol. 118, p. 105570, Jan. 2025, doi: 10.1016/j.scs.2024.105570.
F. M. P. Fozap, “Hybrid Machine Learning Models for Long-Term Stock Market Forecasting: Integrating Technical Indicators,” Journal of Risk and Financial Management, vol. 18, no. 4, p. 201, Apr. 2025, doi: 10.3390/jrfm18040201.
H. N. Bhandari, B. Rimal, N. R. Pokhrel, R. Rimal, K. R. Dahal, and R. K. C. Khatri, “Predicting stock market index using LSTM,” Machine Learning with Applications, vol. 9, p. 100320, Sep. 2022, doi: 10.1016/j.mlwa.2022.100320.
L. Prechelt, “Early Stopping - But When?,” 1998, pp. 55–69. doi: 10.1007/3-540-49430-8_3.
T. Chen and C. Guestrin, “XGBoost,” in Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, New York, NY, USA: ACM, Aug. 2016, pp. 785–794. doi: 10.1145/2939672.2939785.
T. Akiba, S. Sano, T. Yanase, T. Ohta, and M. Koyama, “Optuna,” in Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, New York, NY, USA: ACM, Jul. 2019, pp. 2623–2631. doi: 10.1145/3292500.3330701.
Additional Files
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Admaja, Kurniabudi, Nurhadi

This work is licensed under a Creative Commons Attribution 4.0 International License.





