Creating an effective investment portfolio requires a careful approach to asset selection, risk analysis, and forecasting returns. For optimizing the portfolio for 2025, the Markowitz theory was applied, along with the Python library PyPortfolioOpt, which simplifies the calculation process and allows for the implementation of the key principles of the theory.
What is Markowitz’s Theory?
Markowitz’s theory (or the theory of optimal portfolio) was developed by Harry Markowitz and is based on the concept of asset diversification to reduce risk. The main principles include:
- Diversification. By combining assets with different risk and return levels, the overall risk of the portfolio can be minimized without significantly reducing expected returns.
- Asset covariance. Effective diversification considers how asset returns are related to each other. Assets with low or negative correlation provide more stable portfolio returns.
- Efficient Frontier. Markowitz introduced the concept of the “efficient frontier” — a set of portfolios that offer the highest expected return for a given level of risk.
How was the portfolio formed?
Initial Data:
- Historical stock price data was taken from NASDAQ for the period from 01.01.2020 to 31.12.2024.
- A database of 500+ stocks was used, providing a wide selection for diversification.
- The maximum weight of any asset in the portfolio was limited to 5% to avoid excessive concentration.
Algorithm:
- Data Collection: Historical stock prices were used to calculate the returns and volatility (risk) of each asset.
- Optimization using PyPortfolioOpt:
- A covariance matrix was calculated to assess the relationships between asset returns.
- Optimization was done with the goal of maximizing the Sharpe ratio (the ratio of return to risk).
- A constraint was applied to the weights of the assets in the portfolio (maximum 5% for any individual asset).
- Result: A portfolio was created that combines optimal returns with minimal risk, taking into account the set constraints.
Final Portfolio: Sectors and Assets
The portfolio covers 9 sectors and includes 26 stocks, with diverse weights for each instrument. The list is as follows:
- Technology Sector:
- Arista Networks (ANET) – 5.0%
- NVIDIA Corporation (NVDA) – 5.0%
- Broadcom Inc. (AVGO) – 0.29%
- Healthcare Sector:
- AbbVie Inc. (ABBV) – 5.0%
- Eli Lilly and Company (LLY) – 5.0%
- McKesson Corporation (MCK) – 5.0%
- Cardinal Health, Inc. (CAH) – 2.95%
- Financial Services:
- Cboe Global Markets, Inc. (CBOE) – 5.0%
- The Progressive Corporation (PGR) – 5.0%
- Unum Group (UNM) – 1.38%
- Energy:
- Marathon Petroleum Corporation (MPC) – 5.0%
- Exxon Mobil Corporation (XOM) – 5.0%
- Diamondback Energy, Inc. (FANG) – 0.37%
- Consumer Defensive Sector:
- Walmart Inc. (WMT) – 4.55%
- Philip Morris International Inc. (PM) – 5.0%
- Kellanova (K) – 5.0%
- The Kroger Co. (KR) – 1.27%
- Industrial Sector:
- GE Aerospace (GE) – 5.0%
- Quanta Services, Inc. (PWR) – 5.0%
- Howmet Aerospace Inc. (HWM) – 4.14%
- Steel Connect, Inc. (STCN) – 0.34%
- W.W. Grainger, Inc. (GWW) – 1.88%
- Real Estate:
- Iron Mountain Incorporated (IRM) – 5.0%
- Utilities:
- The Southern Company (SO) – 2.82%
- Consumer Cyclical Sector:
- O’Reilly Automotive, Inc. (ORLY) – 5.0%
Portfolio Results
The portfolio was optimized to maximize returns while accounting for risk limitations. Key metrics:
- Expected Annual Return: 39.0%
- Annual Volatility: 14.1%
- Sharpe Ratio: 2.76
The optimization, based on Markowitz’s theory, resulted in a portfolio with broad diversification across sectors and assets, balancing return and risk. The maximum weight for each asset is limited to 5%, minimizing the impact of any single instrument on the overall portfolio’s performance.
Stay Updated
If you’d like to keep track of weekly changes in this portfolio, as well as stay updated with fresh analytical data and market trends, subscribe to my 🎥 YouTube channel #ChartPadawan. Every week, I publish reviews and share useful information for both beginner and experienced investors. Join our community to stay ahead in the financial markets!