Optimal control of storage under time varying electricity prices