Calculating Expected Rates of Returns for a Portfolio of stocks with Python
So far in the quant journey, we have looked at calculating rates of returns on a single asset. What if an investor has a portfolio made up of multiple assets? The formula for calculating expected returns for a portfolio of securities is:
Translated, this equation simply means this:
Return of Portfolio = Sum(Wa * Ra + Wb * Rb … Wn * Rn)where:
Wa = Weight of Asset a in the portfolio
Wb = Weight of Asset b in the portfolio
Wn = Weight of Asset n in the portfolio
Ra = Rate of Return of Asset a
Rb = Rate of Return of Asset b
Rn = Rate of Return of Asset nSummation of weights = 1
Again, let’s turn to Yahoo finance and construct a portfolio made up of some stocks and check the returns on this portfolio:
This blog post covered the calculation of expected rates of returns in Python. The art of investment is not just about maximizing the rate of returns in some short period but making informed and rational investment decisions based on the dual dimensions of risk and returns. We shall cover how the calculation of risk of securities in Python in the next blog post.