P2P power trading addresses direct energy exchange between peers, thereby energy from small-scale distributed energy resources in households, workplaces, factories, and other locations is exchanged among neighborhood energy prosumers and consumers. A novel method for real-time P2P power trading between nanogrid clusters based on cooperative game theory is proposed in this paper. Cooperative P2P power trading is used as a powerful aid for a nanogrid cluster's power management involving electric vehicles and renewable energy sources (wind turbine and photovoltaic energy system). For the nanogrid clusters' power management, multi-objective optimization making use of relevant information obtained from the Internet of Things and from the time-varying production of hybrid wind power and PV power is carried out. As a result, cooperative P2P power trading between nanogrid clusters can save the electricity cost and amount of energy supplied from the grid, as compared to the stand-alone nanogrid clusters without P2P power trading.