The economical operation of many distributed energy assets relies on effective on-line control, which in turn often requires forecasts to be made. To produce and evaluate forecasts, the error metric by which one measures forecast accuracy must be selected. A new method is presented which customizes a forecast error metric to a given on-line control problem instance, in order to improve the controller's performance. This method is applied to the real-time operation of a battery with the objective of minimizing the peak power drawn by an aggregation of customers over a billing period. In the empirical example considered, customizing the forecast error metric to each problem instance, improved performance by 45% on average, compared to a controller provided with a forecast of the same type, but trained to minimize mean-squared-error. Error metric customization is made possible by two newly proposed parametrized error metrics. The proposed method can be applied to any on-line optimization problem which requires a point forecast as an input, and which can be accurately simulated ahead of time. The method is likely to be most effective in applications where forecasting errors are quite high, as in these applications the choice of forecast error metric significantly affects the forecasts which are produced.