The problem of portfolio selection in the field of financial engineering has received more attention in recent years. This paper presents a novel heterogeneous multiple population particle swarm optimization algorithm (HMPPSO) for solving a generalized Markowitz mean-variance portfolio selection model. The proposed HMPPSO is based on heterogeneous multiple population strategy, in which the whole population is divided into several sub-populations and all the sub-populations evolve with different PSO variants. The communication between the sub-populations is executed at regular intervals to maintain the information exchange inside the entire population and coordinate exploration and exploitation according to certain migration rules. The generalized portfolio selection model is classified as a quadratic mixed-integer programming model for which no computational efficient algorithms have been proposed. We employ the proposed HMPPSO to find the solution for the model and compare the performance of HMPPSO with several classic PSO variants. The test data set is the weekly prices from March, 1992 to September, 1997 including the following indices: Hang Seng in Hong Kong, DAX 100 in Germany, FTSE 100 in UK, S&P 100 in USA and Nikkei 225 in Japan. The computational results demonstrate that HMPPSO is much effective and robust, especially for problems with high dimensions, thus provides an effective solution for the portfolio optimization problem.