This thesis presents a BP Artificial neural network prediction modeling method for forecasting the trend of Shanghai index, and then uses the genetic algorithm to optimize the BP network parameters, weight and structure. The forecasting results show that the optimization algorithm not only avoids BP algorithm into a local minimum point and the problems of slow convergence, but also overcome the GA Shortcomings such as the search time too long and search speed too slow caused by in a similar form of exhaustive search for optimal solution. In the stock market of such a complicated nonlinear stochastic system modeling, this modeling method has high application value.