The dynamometer diagram is widely used to predict the oil well production, and the key point is to analyze the opening and closing points of travelling valve and fixed valve based on pump dynamometer diagram. At present, the usual method is to fit a line according to the discrete points in the pump dynamometer diagram, and compute the slope of the line at each point, which leads a lower accuracy. In this paper, an interactive method to obtain the opening and closing point of travelling valve and fixed valve is proposed, which is based on some priori knowledge of the dynamometer diagram and operators' experience. This method limits the region that the opening and closing points of travelling valve and fixed valve exist, which avoids generating wrong opening and closing points and improve the accuracy of the prediction of oil well production. Two actual oil well dynamometer diagram datasets are used to test the proposed method, and the results show its effectiveness.