In this paper, for dealing with the portfolio model from stocks market, a new particle swarm optimization algorithm (NPSO) is presented, in which the optimal and sub-optimal positions of each particle are considered in the iteration process, and the crossover operation is used to avoid premature. It is demonstrated from optimization tests that NPSO outperforms existed PSO. Then NPSO is used to solve a discontinuous programming model, and four different optimal portfolio selections are displayed which are denoted by S1,S2,S3 and S4, respectively. Finally, actual return rates of these portfolios are obtained, and it is analyzed from related graphs that S2 and S3 gain better results.