Portfolio optimization using Sharpe ratio.
This repository contains code for optimizing a portfolio of assets using Modern Portfolio Theory (MPT) and Python. MPT is a financial theory that aims to construct a portfolio with the highest expected return for a given level of risk. This example uses a portfolio of six assets:
- American Airlines Group Inc. (AAL)
- Airbnb, Inc. (ABNB)
- Berkshire Hathaway Inc. (BRK-B)
- BlackRock, Inc. (BLK)
- Take-Two Interactive Software, Inc. (TTWO)
- Illinois Tool Works Inc. (ILTB)
The code in this repository uses the yfinance library to get historical stock prices and the pandas library to calculate portfolio returns and risks. The code also implements the Sharpe ratio, which is a measure of a portfolio's risk-adjusted return.
To use the code in this repository, you will need to install the yfinance and pandas libraries.