Calculating Expected Rates of Returns for a Portfolio of stocks with Python

Bernard Brenyah
DS Biz
Published in
2 min readSep 18, 2017
Portfolio Returns. Credit: ThinkAdvisor

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:

Mathematical Formula for Portfolio Returns. Credit: munkee.com

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 n
Summation 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:

Tutorial for assessing a portfolio’s expected returns

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.

--

--