Here, we discuss the identification of heterogeneous ensembles for short-term prediction of trends in stock markets. The goal is to predict trends (uptrend, sideways trend, or downtrend) for the next day, the next week, and the next month. A sliding window approach is used; model ensembles are iteratively learned and tested on subsequent data points. We have applied several machine learning approaches, and the models produced using these methods have been combined to heterogeneous model ensembles. The final estimation for each sample is calculated via majority voting, and the confidence in the final estimation is calculated as the relative ratio of a sample's majority vote. We use a confidence threshold that specifies the minimum confidence level that has to be reached. In the empirical section, we discuss results achieved using data of the Spanish stock market recorded from 2003 to 2013.