Summary. We develop a multivariate filter which is an optimal (in the mean-squared error sense) approximation to any absolutely summable and stationary distributed lag of a series of interest containing at most one unit root, e.g. the ideal filter that isolates business cycle fluctuations in macroeconomic time series. This requires knowledge of the true second-order moments of the data. Otherwise these can be estimated and we show empirically that the method still leads to significant improvements of the extracted signal in realtime, i.e. in the end of the sample. Contrary to current practice, we allow an arbitrary number of covariates to be employed in the estimation of the signal. We illustrate the application of the filter by constructing a business cycle indicator for the US economy. The filter can additionally be used in any similar signal extraction problem demanding accurate realtime predictions.