With the advances in smart well technology, substantially higher oil recovery can be achieved by intelligently managing the operations in a closed-loop optimization framework. The closed-loop optimization consists of two parts: geological model updating and production optimization. Both of these parts require gradient information to minimize or maximize an objective function: squared data mismatch or the net present value (or other quantities depending on financial goals), respectively. Alternatively, an ensemble-based method can acquire the gradient information through the correlations provided by the ensemble. Computation of the optimal controls in this way is nearly independent of the number of control variables, reservoir simulator and simulation solver. In this paper, we propose an ensemble-based closed-loop optimization method that combines a novel ensemble-based optimization scheme (EnOpt) with the ensemble Kalman filter (EnKF). The EnKF has recently been found suitable for sequential data assimilation in large-scale nonlinear dynamics. It adjusts reservoir model variables to honor observations and propagates uncertainty in time. The EnOpt optimizes the expectation of the net present value based on the updated reservoir models. The proposed method is fairly robust, completely adjoint-free and can be readily used with any reservoir simulator. The ensemble-based closed-loop optimization method is illustrated with a waterflood example subject to uncertain reservoir description. Results are compared with other possible reservoir operation scenarios, such as, wells with no controls, reactive control, and optimization with known geology. The comparison shows that the ensemble-based closed-loop optimization is able to history match the main geological features and increase the net present value to a level comparable with the hypothetical case of optimizing based on known geology.