We propose a novel Bayesian method to solve the maximization of a time-dependent expensive-to-evaluate stochastic oracle. We are interested in the decision that maximizes the oracle at a finite time horizon, given a limited budget of noisy evaluations of the oracle that can be performed before the horizon. Our recursive two-step lookahead acquisition function for Bayesian optimization makes nonmyopic decisions at every stage by maximizing the expected utility at the specified time horizon. Specifically, we propose a generalized two-step lookahead framework with a customizable emph{value} function that allows users to define the utility. We illustrate how lookahea