Portfolio optimization

A smart investor will want to maximize the return for the amount of risk they are taking. Modern Portfolio Theory was developed in the 1950’s from the founding work of Nobel prize-winning economist Harry Markowitz and is still used to find optimal portfolios with the required return and risk profiles.

For a portfolio of assets, we can estimate each of their expected future returns based on their past returns. We can also calculate how volatile the returns have been using their standard deviation; risk is measured by that volatility. We can also calculate how correlated the returns have been with each other. If two assets go up and down in sync you may not need to own both. You should also want to find assets that compensate for each other’s risk. Given all that, we can calculate the expected total return and expected total volatility of any portfolio given the proportion (weight) of each asset in the portfolio. Inversely, we can find the weights that maximize that return for any given volatility, or the weights that minimize the volatility for any required return. We can also find the optimum weights for the portfolio that maximize a measure of the ratio of expected return to expected volatility: the Sharpe ratio.

The tool first calculates the efficient frontier and shows the expected return, Sharpe ratio and Sortino ratio of the current portfolio. The Sortino ratio is used when you want to disregard up-side volatility since it is not really a risk, and you just want to consider down-side risk. It uses the down-side deviation instead of the standard deviation to get the down-side volatility.

We then allow 3 methods/options:

  1. Rebalance to the maximum Sharpe ratio
  2. Rebalance to the minimum volatility for a given required return
  3. Rebalance to the minimum down-side volatility for a given required return

The tool also allows you (it’s optional) to add constraints such that the target asset allocation of the account is also achieved (for example 30% US Equities / 70% Canadian Equities). Another option available is to enable what I call the diversity constraint. A feature of the model is that it can reduce the diversity of your assets considerably, mostly when you have highly correlated assets. Although a portfolio with far fewer assets may be more optimal according to the theory which maximizes return over risk, investors generally like to keep a variety to also spread the risk. To address that, you can impose a diversity constraint on the model, such that 10% or fewer of the assets are sold entirely (if it can do so). Lastly, given that most brokerages do not allow selling or buying part-shares for stocks, the tool also considers that, and constrains the solutions to full shares for stocks (but not units for funds). This tool does not yet consider taxes or fees (although it is possible to do so, and we may add that later).

The result will display the efficient frontier graph; a red star shows where the selected rebalanced portfolio lies on the constrained frontier. The red star can be off from the blue line due to the full-shares constraint and when you use down-side deviation because the efficient frontier shown is based on the standard deviation. A table shows you the expected return, volatility (or down-side volatility), and the Sharpe (or Sortino) ratio of the rebalanced portfolio. Note that under methods 2 and 3, the ratios can be lower than for your original portfolio.

The next table gives you suggestions of how many shares or units to sell or to buy of each asset so that the resulting portfolio has the optimum weights. A second table shows you the resulting asset allocation of the portfolio, and the last table shows the resulting asset values.

I urge you to take the suggestions with a grain of salt. The next years may not look like the past 3-6 years of market history we used.

A solution may not be found. This usually happens due to the constraints on the asset allocation, so it can be informative in that case. You can check that there is enough variety of assets for each asset class consistent with your preferred asset allocation so that the algorithm can find a solution. You can also try to run the optimization without the asset allocation constraint. Below the tables is a form so you can run a new analysis, varying the parameters, including removing the constraints.

You can also run these tools on MOCK accounts that you can can create from copying and merging several accounts, and even add investments manually to them if there are investments you are considering buying. For rebalancing when adding or withdrawing funds from the account you can add or reduce the "Cash" investment (even to a negative value)