This paper explores the application of the index model in portfolio analysis, highlighting its significance in both macro and security analysis for the optimization of portfolios. Utilizing data spanning from October 2018 to November 2023, the study draws several key conclusions. Firstly, it identifies the optional consumption industry as particularly susceptible to market fluctuations, exhibiting higher sensitivity compared to the daily consumption industry. Secondly, an active portfolio comprising Costco, Walmart, Lululemon, and Under Armour, alongside short positions in risk-free securities, yields the optimal portfolio with a maximized Sharpe ratio. However, the study acknowledges limitations, notably the relatively small sample size and the impact of the COVID-19 pandemic, which introduces extreme risks and potential errors in the analysis. Future research directions include modifying the index model to incorporate volatility adjustments and exploring multi-factor investment models to mitigate errors and enhance portfolio efficiency. This study underscores the importance of continuous refinement and adaptation of analytical frameworks in portfolio management amidst dynamic market conditions.