Predicting Stock Closing Prices: A Random Forest Model Using Fundamental, Technical, Risk, and Macroeconomic Indicators

Jiafan Liu

2025

Abstract

Accurate stock price prediction is crucial for investors and the economy, yet it remains challenging due to market volatility and the limitations of traditional quantitative trading strategies, which struggle to capture nonlinear relationships. This study employs a Random Forest (RF) model to enhance stock closing price prediction ability by integrating fundamental, technical, risk, and macroeconomic indicators. Using stock data from the Chinese A-share market's CSI300 and CSI1000 indices spanning January 2015 to December 2023, the model was trained after preprocessing for missing values and standardization. The evaluation utilized Root Mean Square Error (RMSE), R², and K-Fold Cross-Validation to ensure accuracy and reliability. The model achieved high prediction accuracy, with an RMSE of 8.09 and R² of 0.9927 for BYD Co., Ltd. closing price prediction, and similarly strong performance across 663 other stocks. These findings highlight the effectiveness of combining macro and risk indicators within an RF framework, offering invaluable insights for developing robust quantitative trading strategies that leverage machine learning to address complex market dynamics.

Download


Paper Citation


in Harvard Style

Liu J. (2025). Predicting Stock Closing Prices: A Random Forest Model Using Fundamental, Technical, Risk, and Macroeconomic Indicators. In Proceedings of the 2nd International Conference on Data Science and Engineering - Volume 1: ICDSE; ISBN 978-989-758-765-8, SciTePress, pages 612-618. DOI: 10.5220/0013702800004670


in Bibtex Style

@conference{icdse25,
author={Jiafan Liu},
title={Predicting Stock Closing Prices: A Random Forest Model Using Fundamental, Technical, Risk, and Macroeconomic Indicators},
booktitle={Proceedings of the 2nd International Conference on Data Science and Engineering - Volume 1: ICDSE},
year={2025},
pages={612-618},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0013702800004670},
isbn={978-989-758-765-8},
}


in EndNote Style

TY - CONF

JO - Proceedings of the 2nd International Conference on Data Science and Engineering - Volume 1: ICDSE
TI - Predicting Stock Closing Prices: A Random Forest Model Using Fundamental, Technical, Risk, and Macroeconomic Indicators
SN - 978-989-758-765-8
AU - Liu J.
PY - 2025
SP - 612
EP - 618
DO - 10.5220/0013702800004670
PB - SciTePress