Authors present the stock price prediction algorithm by using Bayesian network. The present algorithm uses the network twice. First, the network is determined from the daily stock price and then, it is applied for predicting the daily stock price which was already observed. The prediction error is evaluated from the daily stock price and its prediction. Second, the network is determined again from both the daily stock price and the daily prediction error and then, it is applied for the future stock price prediction. The present algorithm is applied for predicting NIKKEI stock average and Toyota motor corporation stock price. Numerical results show that the maximum prediction error of the present algorithm is 30% in NIKKEI stock average and 20% in Toyota Motor Corporation below that of the time-series prediction algorithms such as AR, MA, ARMA and ARCH models.