Markov chains have applications in several fields, including but not limited to physics, biology, engineering, economics, and computer science. In the field of computer science, particularly in the areas of algorithm design, it plays a role in complexity theory, network science, and artificial intelligence. In today’s chaotic and complex economic situation, this paper predicts the stock prices of real stocks based on the underlying model of Markov chains. This paper uses the basic Markov chain’s properties, and a new transfer probability vector is derived by multiplying a given initial transfer probability vector with a multi-step probability transfer matrix. The new probability transfer vector is tested to see if it is consistent with the real situation. Repeat the above steps to make multiple predictions. After the prediction results of two different stocks, the result is that the stock price prediction based on the Markov chain is difficult to have high accuracy and can have relatively good prediction results in the short term. However, as the period increases and the factors affecting the stock price increase, the prediction results show more deviations. The result can make more reference for improving the prediction of the stock price prediction model, according to the above problems to make targeted improvements or add more models, to improve the prediction accuracy.