top of page

Maximum Sharpe Ratio Portfolio

The project takes the given portfolio's mean and standard deviation of the returns, then runs 10000 simulations with different weight combinations in order to obtain the portfolio with the highest Sharpe Ratio, which is the optimal portfolio based on the risk and returns. It plots the Capital Market Line(CML) as well, which represents all the portfolios that optimally combine the risk-free rate of return and the market portfolio of risky assets.

Importing the required libraries:

Screen Shot 2022-09-12 at 15.24.33.png

Simulating different weight combinations and obtaining the portfolio with the highest Sharpe Ratio:

Screen Shot 2022-09-12 at 15.25.28.png

Plotting the portfolios and Capital Market Line:

Screen Shot 2022-09-12 at 15.25.49.png

My code to run the function above:

Tickers, timeframe and risk-free rate could be changed as desired.

Screen Shot 2022-09-12 at 15.26.09.png

Final output where the chart is plotted and the optimal weight percentages are calculated:

Screen Shot 2022-09-12 at 15.26.30.png
bottom of page