Skip to content

guccipepito/ModernPortfolio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Efficient Frontier Portfolio Optimization

This Python script implements the efficient frontier portfolio optimization technique using historical stock data. It utilizes the PyPortfolioOpt library for portfolio optimization and visualization.

Features:

• Fetches historical stock data from Yahoo Finance.

• Calculates daily returns, annualized returns, and covariance matrix.

• Constructs efficient frontier and visualizes it using matplotlib.

• Determines the minimum variance portfolio and tangent portfolio.

• Solves the target return problem to find the optimal portfolio.

• Displays portfolio performance metrics and allocation details.

Why is Efficient Frontier important?

Efficient Frontier is a crucial concept in modern portfolio theory that helps investors optimize their portfolios by balancing risk and return. By constructing an efficient frontier, investors can identify the optimal portfolio that offers the highest return for a given level of risk or the lowest risk for a desired level of return. This optimization technique is essential for asset allocation, risk management, and investment decision-making.

Efficient Frontier Calculation:

The efficient frontier is calculated by maximizing the Sharpe ratio, which represents the risk-adjusted return of a portfolio. It involves finding the portfolio allocation that provides the highest Sharpe ratio, indicating the optimal balance between risk and return.

Dependencies:

• pandas

• numpy

• yfinance

• pyportfolioopt

• matplotlib

Usage:

  1. Install the required dependencies using pip install -r requirements.txt.

  2. Run the script efficient_frontier.py to perform portfolio optimization.

  3. Customize the stock tickers, start date, end date, and portfolio value as needed.

  4. View the efficient frontier plot and portfolio performance metrics.

Note:

• Ensure that you have a stable internet connection to fetch historical stock data.

• Adjust the target return and portfolio value according to your investment goals and constraints.

License: This project is licensed under the MIT License.

705d634bc071eaf500a8642f03e8b96d