The stock market is unpredictable,characterized by significant price fluctuations.Establishing scientific models to ana-lyze market and stock statuses and selecting appropriate stock combinations for different investment strategies is crucial.This pa-per proposes a stock status prediction method based on Hidden Markov Model(HMM)and time series models,which effectively analyzes the stock market's status.Subsequently,it predicts stock prices based on different market conditions.Combining these two models helps to mitigate the impact of market volatility on individual model predictions.Finally,based on the model's predic-tions and different investment strategies,suitable stocks are selected for investors to maximize returns.Using the industry compo-nent stocks of the Shanghai and Shenzhen 300 Index that do not overlap with the sample period as samples,considering both prof-itability and risk factors,each stock in the stock pool is scored to select the optimal investment portfolio.Our model achieves good returns during the volatile market conditions of the retrospective period,demonstrating the robustness of combining Hidden Mar-kov Model and time series models.