Accurate stock index prediction is essential for effective investment strategies and economic policymaking. While traditional statistical models often fail to capture the nonlinear dynamics of financial markets, machine learning approaches—particularly Extreme Gradient Boosting (XGBoost)—offer greater flexibility, robustness to overfitting, and computational efficiency. However, the performance of XGBoost strongly depends on hyperparameter tuning, which is difficult to optimize using conventional search methods. To address this, we propose a hybrid framework that integrates XGBoost with Grey Wolf Optimization (GWO) for enhanced hyperparameter selection in stock index forecasting. Using historical data from the Indonesian BBNI stock index (2021–2024) and financial features (price, volume, and temporal), the GWO-optimized XGBoost achieved superior performance, recording the lowest testing MAPE (1.79%), RMSE (108.67), and MAE (84.32). These results surpass classical regressors (Decision Tree, Random Forest, Multilayer Perceptron, Gradient Boosting) by margins of 6–26% and outperform conventional tuning methods (Grid Search, Random Search, Bayesian Optimization) as well as other swarm intelligence approaches (PSO, BA). Moreover, the GWO-based approach reduced error variability and required significantly less optimization time, with the 10-wolf configuration providing the best accuracy–efficiency tradeoff. The scope of this study is limited to a single stock index (BBNI.JK) and financial features, without incorporating macroeconomic indicators, sentiment variables, or cross-market validation. These limitations indicate potential directions for future work to enhance generalizability. Overall, the proposed GWO-XGBoost framework provides a powerful, stable, and time-efficient solution for stock index prediction in volatile market conditions.
Copyrights © 2026