To maximize the microgrids profit in presence of renewable energy resources (RERs), this paper employs the transactive energy (TE) technique for optimal scheduling of the distributed energy resources (DERs) throughout the system. Microgrids can exchange energy with the main grid not only to meet their demand but also to make a profit by active participation in energy and reserve provision process. In this regard, TE can be applied as an effective solution for energy supply management and dynamic balancing between the microgrids and the power grid. In this paper, the participation of five grid-connected commercial microgrids in day-ahead (DA) market is considered. The applicability and the satisfactory performance of the proposed approach are tested and validated on a 10-bus IEEE test system. Simulation results indicate that maximum profit can be achieved for the microgrids with optimal scheduling of the DERs based on the TE approach.