How to not look at your portfolio with Google Sheets automation

Every day at 10am my portfolio “wakes up” and sees if anything needs to be rebalanced. If it finds something that needs to be rebalanced, then it sends me an email. That takes away one more excuse for me to obsessively look at my portfolio and makes it easier to tune out the financial noise.

Why don’t I just rebalance once a year? That’s by far the most common suggestion, after all. In “Opportunistic Rebalancing: A New Paradigm for Wealth Managers” (Daryanani, Journal of Financial Planning, 2008) explored several rebalancing algorithms. He noted that any rebalancing algorithm needs three inputs: the rebalancing band, the tolerance band, and the frequency of looking.

  • Rebalancing band: This defines if you need to rebalance. This is a measure of how far away from the target allocation you are allowed to go before you rebalance. If your target for Small Cap Value (SCV) is 20% of your portfolio and your rebalancing band is 20% then if SCV drops below 16% of your portfolio or above 24% of your portfolio, then you would rebalance.
  • Tolerance band: This defines where you rebalance to. This shows you how close to your target allocation you need to get when rebalancing. This will always be less than the rebalancing band. Going back to the SCV example above. If your tolerance band is 10% then you would rebalance to the range 18%—22%. If your tolerance band is 0% then you always rebalance to exactly 20%. Having a tolerance band greater than 0% gives you some flexibility when rebalancing.
  • Frequency of looking: How often you check to see if you need to rebalance. You could do it annually, quarterly, monthly, weekly, or daily.
Image for post
Image for post

There are a lot of interesting things going on in this table.

  • A 0% rebalancing band performs the worst. There’s value in not being dogmatic. (A reminder: a 0% rebalancing band means you always to exactly your target. If you are at 21% SCV, then you rebalance to 20%.)
  • The wider your rebalancing band the better…up to a point. A 5% rebalancing band does better than a 0% rebalancing band under every situation. A 10% band does better than a 5%. And so on. But things appear to peak at 20%. A 25% band not only performs worse than a 20% band, it also performs worse than a 15% band. A wider band allows you to capture more momentum but it appears you can have too much of a good thing.
  • With a narrow band (0%—10%) annual rebalancing works best. (Score one for the common wisdom!)
  • With wide bands (20%—25%) checking every day works best.

The optimal choice according to Daryanani is a 20% rebalancing band, 10% tolerance band, and daily frequency of looking. This is the difference between 9.449% return (0% band checked annually) and a 9.684% return. 0.23% extra a year just for making a slight change in the mechanics of how you rebalance.

One problem with Daryanani’s results is they suggest you should look at your portfolio every day and see if anything needs to be rebalanced. Not only is that inconvenient, it probably helps encourage financial porn addiction and bad decisions. I mean, you’re just going to Morningstar to see if anything needs to be rebalanced but you notice that international is down again…and you’ve been hearing so much about Brexit recently…and maybe 20% international is really too much…Stop it!

You can automate all of this with the Script editor in Google Sheets.

Then you need brush up on your JavaScript. (Easy, right?)

function rebalance_check() {
Perform magic to see if you need to rebalance.
The exact magic depends on your spreadsheet.
if (needed) {
'[Portfolio] Rebalancing is required',
'Link to spreadsheet');

Once you’ve got your script done, you can add a trigger (under Resources > Current project’s triggers) so that it runs whenever you want.

Image for post
Image for post

Now you’ve got a sentient portfolio.

Written by

Learn how to enjoy early retirement in Vietnam. With charts and graphs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store