Abstract:The fluctuation of stock price in a period of time is very significant to study and forecast the stock. In this paper, we use the Hierarchical clustering thought to improve K-means clustering, and to custer stock price fluctuation trend. Then select the optimal cluster number within a certain range. The clustering effect is better than that of the original K-means clustering algorithm, which will help to forecast the trend of stock price in the future.