With the time-varying renewable energy generation and power demand, microgrids (MGs) exchange energy in smart grids to reduce their dependence on power plants. In this paper, we formulate an MG energy trading game, in which each MG trades energy according to the predicted renewable energy generation and local energy demand, the current battery level, and the energy trading history. The Nash quilibrium (NE) of the game is provided, revealing the conditions under which the local energy generation ...