In recent years, securities investors hope to obtain certain income from securities investment by buying stocks. By referring to the historical trading data of the stock market, investors take into account various technical indicators and related financial data of listed companies to analyze and determine the investment plan, and select the appropriate stock for investment, which is relatively time-consuming and energy consuming. In this paper, LSTM short and long-term memory neural network is used for data modeling analysis, in-depth analysis of the inherent characteristics of the data, research on stock trend prediction, stock price prediction model is constructed, and the prediction effect of the stock market is explored. To examine different model structures to forecast the effect of future stock prices, and optimize the stock prediction model, by controlling the stock prediction model of variable of the factors affecting the prediction effect of contrast experiment results were analyzed, and the evaluation model prediction accuracy, to build and train a good stock prediction model. Finally, combined with the optimized stock price prediction model, it can help investors make better investment decisions and bring relatively stable income for investors.