Flexible Demand Management Under Time-Varying Prices