How to decide the balance of the pie percentage?

Here is another method of calculating the weightings of a smaller portfolio: https://github.com/nickspacemonkey/efficient_frontier/blob/master/efficient_frontier.py

This method is probably better suited to a smaller portfolio as oppose to sorting by market cap for larger ones.

I have taken the FAANG stocks plus Microsoft, and taken the daily closing price from yahoo since 01/01/2010. This data is used to calculate covariances and average daily returns. 2500 random portfolio weightings are then created with standard deviations and returns calculated using the covariance matrix. These portfolios are then plotted to help visualise expected return for amount of volatility taken.

The optimal portfolio would get the higest return for least amount of volatility taken. The weightings and other pertinent data is shown in console:

image

3 Likes