Abstract This paper studies the optimal energy management in a group of dwellings having micro fuel cell combined heat and power systems. To increase self-sufficiency resilience such local community, P2P trading system between is proposed which output powers from cells working under their rated can be sold to those already reach outputs but still lack powers. The arising optimization problem th...