This paper proposes the Whale optimization Algorithm (WOA) to solve Dynamic Optimal Power Flow (D-OPF) problems with Valve Point Effect (VPE) considering of Energy Storage (ES). D-OPF is an OPF that considers the ramp rate of the generator, because D-OPF performs the generator optimization process online within 24 hours of operation. D-OPF with VPE causes the generation cost function to be non-linear and non-smooth. The complexity of the problems in the paper is increasing with the presence of energy storage in the system. To solve the problems in this paper, the WOA method is proposed. WOA is a metaheuristic method that has 2 main phases, exploration and exploitation. This exploitation and exploration allows WOA to move from the local optimal to the global optimal. In addition, this paper highlights the D-OPF simulation model which is carried out directly (24 hours of operation is carried out in 1 simulation directly, not every hour separately). This is intended to ensure that there is coupling between operating first hours to operating second hours and so on. And the amount of battery charge (charging discharging) in 1 day is equal to 0 (zero). This is to ensure that there is sufficient energy in the battery for the next period of operation. The effectiveness of WOA in this problem was tested in 2 problems, namely the IEEE 9, 14 systems and validated with other algorithm.