Energy systems are undergoing radical changes that have resulted in buildings being regarded as proactive players with the potential to contribute positively energy networks. This study investigates role of active (ABs) prosumers by introducing a building-to-building (B2B) strategy for exchange between residential units, well building-for-grid (B4G) model exploiting demand flexibility microgrid...