Short-Term IHSG Closing Price Prediction Using Random Forest
Predicting stock market prices is challenging due to the complex and volatile nature of financial time series. This study examines the use of Random Forest Regression (RFR) to predict the closing prices of the Jakarta Composite Index (IHSG) from January 2015 to May 2025. Historical data were collected from Yahoo Finance, preprocessed, and engineered into seven predictor features, including lagged prices, moving averages, volatility measures, and a COVID-19 event indicator.The dataset was split into training and testing sets (80:20) using a time-based approach. Hyperparameters were optimized via RandomizedSearchCV with TimeSeriesSplit cross-validation. The final model achieved an RMSE of 177.55 and an R² of 0.71 on the testing set, demonstrating strong predictive performance. Feature importance analysis indicated that the previous day’s closing price (lag_1) was the most influential predictor, followed by lag_2 and MA_7.Visualizations showed that the model effectively captured major trends and turning points, with minor deviations during extreme volatility. The next-day prediction for May 23, 2025, yielded a closing price of 7145.12, indicating practical applicability for short-term investment decisions. The results highlight that Random Forest Regression is a robust and effective method for predicting financial time series, capable of handling non-linear patterns and market fluctuations
Authors
- Sabarudin Saputra (ORCID: https://orcid.org/0009-0001-0646-7053)
- Wildan
- Ayu Hernita
- Oki Derajat Sudarmojo
- Nur Alinuddin Kaharu
Institutions
- Tadulako University (ID)
- Gunadarma University (ID)
Publication Details
- Journal
- Information Technology Education Journal
- Published
- 2025-08-28
- DOI
- https://doi.org/10.59562/intec.v4i3.9549
- Primary Topic
- Consumer Market Behavior and Pricing
- Type
- article
- Field-Weighted Citation Impact
- 0.00