UNDERSTANDING THE MATHEMATICAL BACKGROUND OF MODERN PORTFOLIO THEORY
Authors: Kaya Ibrahim 
Published: January 2025

Purpose- Modern Portfolio Theory (MPT), pioneered by Harry Markowitz, provides a quantitative framework for portfolio optimization by balancing risk and return through diversification. This study focuses on applying MPT principles using Python and the PyPortfolioOpt library to construct optimized portfolios. The analysis involves selecting high-performing U.S. stocks over the past year, implementing advanced optimization techniques, and evaluating performance metrics such as Sharpe ratios. By leveraging these methodologies, the study aims to demonstrate how MPT, combined with Python's computational power, can enhance investment decision-making.
Methodology- The study incorporates a systematic approach to portfolio optimization. Data was collected from TradingView, focusing on high-performing stocks across various sectors. The optimization process utilized PyPortfolioOpt for mean-variance optimization, risk parity, and minimum correlation portfolio construction. Historical price data was preprocessed for normalization, and statistical techniques such as correlation analysis and covariance matrix evaluation were applied to ensure robust portfolio allocation. Sharpe ratios were calculated to assess the risk-adjusted returns of the portfolios.
Findings- This study demonstrates the practicality of Modern Portfolio Theory (MPT) when combined with python-based portfolio optimization techniques. Using the PyPortfolioOpt library, the analysis highlights how computational tools enhance portfolio construction by balancing risk and return. The optimized portfolio, based on high-performing U.S. stocks, achieved an expected annual return of 8.39%, annualized volatility of 17.36%, and a Sharpe ratio of 1.76, showcasing efficient risk-adjusted performance. Diversification emerged as a key factor in mitigating risk, with weights allocated to stocks from various sectors to balance returns and volatility. Assets with lower Sharpe ratios or high correlations were excluded, aligning with MPT’s principles. Risk management strategies, including covariance matrix evaluation, ensured a robust portfolio structure. The results validate the effectiveness of python-driven optimization in building diversified portfolios that cater to investment objectives.
Conclusion- This study reaffirms the relevance of Modern Portfolio Theory (MPT) in portfolio management while showcasing Python's capabilities for optimization. The optimized portfolio achieved a sharpe ratio of 1.76, exemplifying the balance between maximizing returns and minimizing risk. Diversification and systematic data analysis played pivotal roles, with weights favoring assets offering favorable risk-return profiles.The findings underline the value of combining MPT with computational tools like PyPortfolioOpt to construct portfolios that align with diverse financial goals. However, further research could explore dynamic market conditions, broader datasets, and alternative risk metrics to improve portfolio resilience and adaptability. This study highlights the potential of python-driven optimization to bridge financial theory and practical application, enabling robust and efficient portfolio management in dynamic markets.

Keywords: Modern Portfolio Theory, Portfolio Optimization, PyPortfolioOpt, Risk Management, Sharpe Ratio
JEL Codes: C61, G11