The uncertain and stochastic output of the wind farm results in a lot of problems when it is connected to the power grid. In order to improve the wind power's friendship to the grid, the wind farm should has a certain self-discipline level. In this paper, it is studied from the perspective of the wind farm self-discipline interval. First, the concept of wind farm self-discipline interval is proposed, followed by a comprehensive index which is used to evaluate the wind farm self-discipline level by comprehensively considering the interval width and the interval accuracy. Second, an optimization method is discussed to obtain the optimal self-discipline interval. This method has general applicability, not only suitable for normal distribution and other known distributions but also for arbitrary distributions (such as non-symmetric, multi-peak distributions). Finally, the size of the energy storage system (ESS) in the wind farm is optimized to guarantee a suitable wind farm self-discipline level. Simulation results show that the proposed method not only effectively improves the self-discipline level of the wind farm but also has general applicability. INDEX TERMS Wind power, self-discipline, energy storage system (ESS), optimization.