In this paper, we propose a periodic energy trading system in microgrids based on day-ahead forecasting of energy generation and consumption. In the proposed model, each noncooperative prosumer calculates her reward function under her energy change forecasting based on Gaussian process regression and determines her optimal action. Then, the system establishes the equilibrium trading price when all prosumers execute their optimal actions simultaneously. We prove the existence of the equilibrium trading price and establish an algorithm that leads to the equilibrium. Our numerical example shows that the proposed system outperforms its previous model.