In recent years, microgrids (MG's) have operated in the power systems for various reasons such as reduction of energy losses, improvement of voltage stability and grid reliability. The implementation of Home Microgrid (H-MG) has proven successful in tackling these issues. This paper proposes a novel techno-economic multi-level optimization method and modern time varying price model aimed at encouraging participation in a coalition system, minimizing energy cost of a Home Microgrid (H-MG) and investigate the impact it has on voltage stability and reliability of the grid. The intended H-MG includes an apartment with several units which consist of electrical and thermal energy generators, energy storage devices and can trade energy within the H-MG's and the upstream network. The proposed method develops an algorithm for smart charging/discharging of energy storage and electric vehicles (EV) to improve energy efficiency. The performance of the proposed algorithm is tested on several electrical and thermal loads configurations, the IEEE 15 and 33-bus networks are used to prove the efficiency of the coalition system between the H-MG on a large scale. The simulations are implemented on MATLAB software and results indicate an improvement in voltage profiles and grid reliability.