Swimming pool heating systems are known as one of the best flexible resources in buildings. However, they can be flexible only for a certain number of hours throughout a day due to the comfort constraints of the users. In this study, a new approach is proposed to determine a group of contract hour sets to procure maximum flexibility of swimming pool heating systems supplied by heat pumps for trading in the regulation market while respecting the comfort of users. The main advantage of the contract hour sets is the certainty in response to flexibility requests. The proposed approach consists of three main steps. First, a stochastic mixed-integer linear program is proposed to find the optimal operation of a swimming pool heating system that has agreed to provide flexibility in a contract hours set. Then, a metric is proposed to evaluate the effectiveness of contract hour sets using the results obtained in the first step. Finally, an algorithm is proposed to identify a group of the most efficient contract hour sets using the calculated metric. The proposed approach is validated through comprehensive simulation studies for a summerhouse with an indoor pool heated by a heat pump. Also, a cost–benefit analysis is performed to examine the feasibility of these contract hour sets from financial viewpoint. Simulation results show that the maximum contract hours can vary from 2 to 12 h depending on the building occupation pattern and the minimum payment to owners is between 0.03 to 0.06 (Euro/kW).