Practical Closed-loop Dynamic Pricing in Smart Grid for Supply and Demand Balancing