New gene expression programming based on niche is proposed to overcome the shortcoming of basic gene expression programming that it is easy to lose the population diverse in the later period of evolution, and then to avoid premature convergence. The algorithm uses a niche to contain the individuals of same fitness. When a niche is filled to capacity, other individuals who want to join the niche will be initialized. Experiments show that the new GEP algorithm based on niche can preserve population diversity and then can avoid premature convergence effectively, greatly improve the ability to search the optimal resolution.