Stock data is high-noise, non-stationary, and nonlinear time series data, which traditional financial econometric models often struggle to accurately predict. In this study, BP neural networks and LSTM were used to model and predict. Then compare their performance in terms of metrics such as MAE, MSE, and MAPE. The research results showed that the LSTM neural network had lower prediction errors and its predictions were closer to the true stock price. The study found that LSTM neural networks have higher accuracy in predicting stock prices compared to BP neural networks. This discovery has practical application value in the financial field because accurate stock price predictions can help investors make more informed investment decisions.