Abstract:With the rapid development of artificial intelligence, deep learning model prediction of financial time series has become a hot issue. The selection of data and features is important for the effect of the model. XGBoost is used to optimize the features and predict the trend of gold price trend, and then the prediction effect is compared with LSTM. XGBoost is used to analyze the importance of momentum factors and select effective features. The morphological factors are tested on historical data,and the candlestick chart with higher accuracy rate are selected, the prediction accuracy is increased by 1.5 percent.The same factors are used in LSTM, and the prediction accuracy is increased by 6.5 percent to 80 percent. Taking Euro and SPD Bank stock price data as samples, it is proved that the prediction effect of LSTM is better than that of XGBoost.