This work presents a simple and efficient way of estimating the steady-state cost gradient Ju based on available uncertain measurements y. The main motivation is to control Ju to zero in order to minimize the economic cost J. For this purpose, it is shown that the optimal cost gradient estimate for unconstrained operation is simply Jˆu=H(ym−y∗) where H is a constant matrix, ym is the vector of measurements and y∗ is their nominally unconstrained optimal value. The derivation of the optimal H-matrix is based on existing methods for self-optimizing control and therefore the result is exact for a convex quadratic economic cost J with linear constraints and measurements. The optimality holds locally in other cases. For the constrained case, the unconstrained gradient estimate Jˆu should be multiplied by the nullspace of the active constraints and the resulting “reduced gradient” controlled to zero.