Prediction of stock prices is a classic problem. People are always trying to predict stock prices as accurately as possible, and also trying to build stock price model. With the development of technology, machine learning has been applied more and more to stock prediction problems, and good results have been obtained. This paper selects the Shanghai Stock Composite Index from 1990 to 2016 and forecasts its closing price. First, the ARIMA (1,1,1) model is established for the closing price sequence after first-order difference, and then the two-layer LSTM model is constructed to visualize the prediction results of the two models and calculate rmse respectively. Comparing the prediction results of the two models, it is concluded that LSTM has better prediction effect on the data set used in this paper. This paper find that ARIMA has some cons that it is Not built for long-term forecasting and parameters are subjective. It does not predict as well as LSTM when there is a turning point.