A distributed optimization algorithm based on ADMM is presented to solve a dynamic economic dispatch problem including smart loads and distributed generators in a transactive control scheme for microgrids while preserving individual privacy. The proposed algorithm is validated through simulation of a 30-node testbed in several scenarios including fixed and adjustable loads.