BYD Stock Price Prediction Based on LSTM and XGBoost Models
Abstract
. The stock performance of BYD (002594.SZ) is attracting increasing attention. This research aims to use eXtreme Gradient Boosting (XGBoost) and Long Short-Term Memory (LSTM) to predict BYD’s next trading day’s closing price and compare their performances. The research used BYD stock data from 2015 to 2025. The research constructed close, volume, 5-day and 20-day simple moving averages (MA5, MA20) and Relative Strength Index (RSI) as lagged features, and used Mean Absolute Error (MAE), Root Mean Square Error (RMSE) and R2 as evaluation indicators. The result was the LSTM model had better performance compare to the XGBoost model on the dataset from 2015 to 2025 and the dataset from 2015 to 2024. The conclusion is XGBoost trains faster and has stable performance while LSTM has better generalization stability and usually performs better. The framework of this research could also be used to other stocks’ prediction.