Performance Comparison of Random Forest and Gradient Boosting Algorithms in Large-Cap Indonesian Energy Sector Trading Strategies
DOI:
https://doi.org/10.21460/jutei.2026.102.483Keywords:
Random Forest, Gradient Boosting, technical indicators, backtesting, energy stocksAbstract
This study compares the performance of Random Forest and Gradient Boosting in developing machine learning-based trading strategies for large-cap energy sector stocks in Indonesia. The analyzed stocks consist of BYAN, DSSA, CUAN, BUMI, ADRO, ADMR, AADI, TCPI, PTRO, and PGAS, selected from the IDNFinancials energy sector list in May 2026. Daily historical data were obtained from Yahoo Finance for the period from 2020 to April 2026. Technical indicators were constructed from momentum, volatility, and trend groups, while feature selection was performed exclusively on the training data using Spearman rank correlation. The final features selected for all stocks were RSI_14, BB_LOWER, and EMA_20. The data were divided chronologically into training, evaluation, and backtesting periods with an approximate 70:20:10 proportion and a five-trading-day purging gap between consecutive periods. Hyperparameter tuning was conducted using five-fold TimeSeriesSplit with a five-observation gap. Random Forest and Gradient Boosting showed relatively similar classification performance, with mean accuracies of approximately 0.528 and 0.531, respectively, indicating that neither model consistently dominated across all stocks. The best financial performance was obtained by Gradient Boosting on TCPI, producing a return of 61.578%, a win rate of 72.727%, and 11 trades, although the result remained below the Buy and Hold return of 103.540%. Sensitivity analysis further showed that classification performance and trading performance did not necessarily move in the same direction. These findings indicate that classification accuracy alone is insufficient for evaluating machine learning-based trading strategies and should be complemented by financial performance and robustness analysis.
References
[1] TradingView, “Sectors - Stock Market - Indonesia,” TradingView. Accessed: Jun. 09, 2026. [Online]. Available: https://www.tradingview.com/markets/stocks-indonesia/sectorandindustry-sector/
[2] “Bursa Efek Jakarta & Indonesia | Pasar Keuangan Indonesia.” Accessed: May 18, 2026. [Online]. Available: https://www.idnfinancials.com/id/company/sector/energi-a
[3] K. Saetia and J. Yokrattanasak, “Stock Movement Prediction Using Machine Learning Based on Technical Indicators and Google Trend Searches in Thailand,” Int. J. Financ. Stud., vol. 11, no. 1, p. 5, Dec. 2022, doi: 10.3390/ijfs11010005.
[4] N. A. Haryono, Y. Lukito, and A. W. Mahastama, “Feature Engineering for Machine Learning-Based Trading Systems Using Decision Tree, Random Forest, and Gradient Boosting,” Int. J. Adv. Comput. Sci. Appl., vol. 16, no. 12, 2025.
[5] A. M. Fatihah, K. Dharmawan, and P. V. Swastika, “Implementation of X-Gradient Boosting in Banking Stock Price Predictions,” in Proceedings of the First International Conference on Applied Mathematics, Statistics, and Computing (ICAMSAC 2023), vol. 110, K. Dharmawan and N. A. Sanjaya Er, Eds., in Advances in Computer Science Research, vol. 110. , Dordrecht: Atlantis Press International BV, 2024, pp. 170–181. doi: 10.2991/978-94-6463-413-6_17.
[6] Indra et al., “Stock Return Prediction on the LQ45 Market Index in the Indonesia Stock Exchange Using a Machine Learning Algorithm Based on Technical Indicators,” J. Risk Financ. Manag., vol. 18, no. 12, p. 714, Dec. 2025, doi: 10.3390/jrfm18120714.
[7] “RandomForestClassifier,” scikit-learn. Accessed: Jun. 09, 2026. [Online]. Available: https://scikit-learn/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html
[8] “GradientBoostingClassifier,” scikit-learn. Accessed: Jun. 09, 2026. [Online]. Available: https://scikit-learn/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html
[9] “Metrics and scoring: quantifying the quality of predictions,” scikit-learn. Accessed: Jun. 09, 2026. [Online]. Available: https://scikit-learn/stable/modules/model_evaluation.html
[10] TradingView, “Apa Itu Strategi, Backtesting dan Forward Testing,” TradingView. Accessed: Jun. 09, 2026. [Online]. Available: https://id.tradingview.com/support/solutions/43000562362/
[11] O. Polakow, “Getting Started VectorBT.” Accessed: Jun. 09, 2026. [Online]. Available: https://vectorbt.dev/
[12] Otoritas Jasa Keuangan, Buku Saku Cerdas Mengelola Keuangan. Jakarta, 2021.
[13] “PPh Pasal 4 ayat (2),” Direktorat Jenderal Pajak. Accessed: Aug. 22, 2026. [Online]. Available: http://www.pajak.go.id/index.php/id/pph-pasal-4-ayat-2
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Gregorius Daniel Jodan Perminas, Michael Chandra

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
Authors who publish articles in JUTEI agree on the following rules:
1. The author grants non exclusive royalty free rights, and is willing to publish articles online and complete (full access). With such rights JUTEI reserves the right to save, transfers, manages in various forms, maintains and publishes articles while keeping the author's name as the copyright owner.
2. Each author contained in the article has contributed fully to the substance and intellectual, and is accountable to the public. If in the future there is a copyright infringement notification then this will be responsibility of the author, not JUTEI.




