Traditional molecular dynamics simulation of biomolecules suffers from the conformational sampling problem. It is often difficult to produce enough valid data for post analysis such as free energy calculation and transition path construction. To improve the sampling, one practical solution is putting an adaptive bias potential on some predefined collective variables. The quality of collective variables strongly affects the sampling ability of a molecule in the simulation. In the past, collective variables were built with the sampling data at a constant temperature. This is insufficient because of the same sampling problem. In this work, we apply the standard weighted histogram analysis method to calculate the multi-ensemble averages of pairs of time-lagged features for the construction of both linear and nonlinear slow collective variables. Compared to previous single-ensemble methods, the presented method produces averages with much smaller statistical uncertainties. The generated collective variables help a peptide and a miniprotein fold to their near-native states in a short simulation time period. By using the method, enhanced sampling simulations could be more effective and productive.