Implementasi Algoritma XGBoost dengan Walk Forward Validation untuk Prediksi Harga Emas Antam

Authors

  • Mochammad Hisyam Universitas Malikussaleh, Lhokseumawe
  • Zahratul Fitri Universitas Malikussaleh, Lhokseumawe
  • Hafizh Al Kautsar Aidilof Universitas Malikussaleh, Lhokseumawe

DOI:

https://doi.org/10.30865/jurikom.v12i4.8693

Keywords:

Gold Price Prediction, XGBoost, Bayesian Optimization, Walk Forward Validation, Technical indicators

Abstract

Accurate gold price prediction is crucial in supporting financial and investment decision-making. This study aims to develop and optimize a daily gold price prediction model using the Extreme Gradient Boosting (XGBoost) algorithm based on historical price data and technical indicators. The model was constructed to predict two types of prices, namely "Close" and "Buyback" prices in IDR/gram. Optimization was carried out using Bayesian Optimization to obtain the best hyperparameter combinations. The model was evaluated using a Walk Forward Validation (WFV) approach with a 14-day sliding window and two main evaluation metrics: Root Mean Square Error (RMSE) and Mean Absolute Percentage Error (MAPE). The results show that the model provides excellent predictive performance, with an average RMSE of 15,431.92 and MAPE of 1.03% for Close price, and RMSE of 15,382.64 and MAPE of 1.15% for Buyback price. The prediction visualizations indicate that the model consistently follows the actual price trend. Feature importance analysis reveals that technical indicators such as RSI, EMA, and MACD significantly contribute to the model. The success of this study demonstrates that an optimized XGBoost model can serve as a reliable approach for gold price forecasting and opens opportunities for developing more advanced predictive models in future research.

References

A. Tholib, N. K. Agusmawati, and F. Khoiriyah, “PREDIKSI HARGA EMAS MENGGUNAKAN METODE LSTM DAN GRU,” Jurnal Informatika dan Teknik Elektro Terapan, vol. 11, no. 3, Aug. 2023, doi: 10.23960/jitet.v11i3.3250.

R. A. Nadir and R. N. Sukmana, “Sistem Prediksi Harga Emas Berdasarkan Data Time Series Menggunakan Metode Artificial Neural Network (ANN),” Digital Transformation Technology, vol. 3, no. 2, pp. 426–437, Sep. 2023, doi: 10.47709/digitech.v3i2.2877.

R. F. Sholeh, B. A. Dermawan, and I. Maulana, “PERAMALAN HARGA EMAS DI INDONESIA MENGGUNAKAN ALGORITMA DOUBLE EXPONENTIAL SMOOTHING DAMPED TREND FORECASTING GOLD PRICE IN INDONESIA USING DOUBLE EXPONENTIAL SMOOTHING DAMPED TREND ALGORITHM,” Journal of Information Technology and Computer Science (INTECOMS), vol. 4, no. 2, p. 2021.

S. Sholiha and W. U. Dewi, “Sciencestatistics Journal of Statistics, Probability, and Its Application Penggunaan ARIMA Box-Jenskin dalam Meramalkan Harga Emas Antam Tahun 2025-2027 di Indonesia,” vol. 2, no. 2, pp. 59–69, 2024, [Online]. Available: https://scholar.ummetro.ac.id/index.php/sciencestatistics/index

A. Mulya Hadi, W. Witanti, J. Informatika, and U. Jenderal Achmad Yani, “Agustus 2024 486 PREDIKSI PERGERAKAN HARGA EMAS MENGGUNAKAN METODE GENETIC SUPPORT VECTOR REGRESSION,” Jurnal Informatika Teknologi dan Sains.

P. Dipti and P. Trupti, “GOLD PRICE PREDICTION USING MACHINE LEARNING,” www.irjmets.com @International Research Journal of Modernization in Engineering, [Online]. Available: www.irjmets.com

G. Cohen and A. Aiche, “Forecasting gold price using machine learning methodologies,” Chaos Solitons Fractals, vol. 175, p. 114079, Oct. 2023, doi: 10.1016/J.CHAOS.2023.114079.

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.

D. N. Gono, H. Napitupulu, and Firdaniza, “Silver Price Forecasting Using Extreme Gradient Boosting (XGBoost) Method,” Mathematics, vol. 11, no. 18, Sep. 2023, doi: 10.3390/math11183813.

B. Jiao and I. A. Fulton, “Gold Prediction Based on XGBoost and OLS,” 2024.

M. R. Nurhambali, Y. Angraini, and A. Fitrianto, “Implementation of Long Short-Term Memory for Gold Prices Forecasting,” Malaysian Journal of Mathematical Sciences, vol. 18, no. 2, pp. 399–422, 2024, doi: 10.47836/mjms.18.2.11.

Z. H. Kilimci, “Ensemble Regression-Based Gold Price (XAU/USD) Prediction,” APA, 2022.

“Harga Emas Hari Ini.” Accessed: May 29, 2025. [Online]. Available: https://pusatdata.kontan.co.id/market/logam_mulia

G. Huang, “Missing data filling method based on linear interpolation and lightgbm,” in Journal of Physics: Conference Series, IOP Publishing Ltd, Feb. 2021. doi: 10.1088/1742-6596/1754/1/012187.

“Data Preparation for XGBoost | XGBoosting.” Accessed: May 29, 2025. [Online]. Available: https://xgboosting.com/data-preparation-for-xgboost

M. Anjas Aprihartha, M. Husniyadi, and T. Nur Alam, “IMPLEMENTASI METODE RANDOM FOREST DALAM MEMPREDIKSI SINYAL PERGERAKAN SAHAM,” vol. 14, no. 1, pp. 43–49, doi: 10.24843/MTK.2025.v14.i01.p477.

M. Rizky Mubarok, R. Herteno, I. Komputer Fakultas Matematika dan Ilmu Pengetahuan Alam Universitas Lambung Mangkurat Jalan Ahmad Yani Km, and K. Selatan, “HYPER-PARAMETER TUNING PADA XGBOOST UNTUK PREDIKSI KEBERLANGSUNGAN HIDUP PASIEN GAGAL JANTUNG.”

A. Stuke, P. Rinke, and M. Todorovic, “Efficient hyperparameter tuning for kernel ridge regression with Bayesian optimization,” Mach Learn Sci Technol, vol. 2, no. 3, Sep. 2021, doi: 10.1088/2632-2153/abee59.

S. Ben Jabeur, S. Mefteh-Wali, and J. L. Viviani, “Forecasting gold price with the XGBoost algorithm and SHAP interaction values,” Ann Oper Res, vol. 334, no. 1–3, pp. 679–699, Mar. 2024, doi: 10.1007/s10479-021-04187-w.

H. Supriyanto, “A COMPARISON OF SUPERVISED LEARNING METHODS FOR FORECASTING TIME SERIES IN OUTSIDE PATIENT VISITS,” vol. 10, no. 2, 2022.

Y. Syukriyah and A. Purnama, “Knowbase : International Journal of Knowledge in Database Modelling Time Series Data for Stock Prices Prediction Using Bidirectional Long Short-Term Memory Keywords RNN BiLSTM Time Series Data Stock Prices Correspondence,” International Journal of Knowledge in Database, vol. 04, no. 02, pp. 115–129, doi: 10.30983/knowbase.v4i2.8759.

B. Pengelola and K. Haji, Investasi Emas BPKH. [Online]. Available: www.bpkh.go.id

“Interpretable Machine Learning.” Accessed: May 29, 2025. [Online]. Available: https://christophm.github.io/interpretable-ml book/

Additional Files

Published

2025-08-14

How to Cite

Hisyam, M., Fitri, Z., & Aidilof, H. A. K. (2025). Implementasi Algoritma XGBoost dengan Walk Forward Validation untuk Prediksi Harga Emas Antam . JURNAL RISET KOMPUTER (JURIKOM), 12(4), 403–413. https://doi.org/10.30865/jurikom.v12i4.8693