This paper presents a smart Transactive energy (TE) framework in which home microgrids (H-MGs) can collaborate with each other in a multiple H-MG system by forming coalitions for gaining competitiveness in the market. Profit allocation due to coalition between H-MGs is an important issue for ensuring the optimal use of installed resources in the whole multiple H-MG system. In addition, considering demand fluctuations, energy production based on renewable resources in the multiple H-MG can be accomplished by demand-side management strategies that try to establish mechanisms to allow for a flatter demand curve. In this regard, demand shifting potential can be tapped through shifting certain amounts of energy demand from some time periods to others with lower expected demand, typically to match price values and to ensure that existing generation will be economically sufficient. It is also possible to obtain the maximum profit with the coalition formation. In essence the impact of the consumption shifting in the multiple H-MG schedule can be considered while conducting both individual and coalition operations. A comprehensive simulation study is carried out to reveal the effectiveness of the proposed method in lowering the market clearing price (MCP) for about 15% of the time intervals, increasing H-MG responsive load consumption by a factor of 30%, and promoting local generation by a factor of three. The numerical results also show the capability of the proposed algorithm to encourage market participation and improve profit for all participants.