Wednesday, April 29, 2020

Portfolio Rebalancing Based on Expected Profit and Trading Costs (Redux)

The idea of rebalancing a portfolio to maintain target asset allocation percentages is simple in theory, but tricky in practice. It is not obvious how far asset class percentages should be away from their targets before it makes sense to rebalance. I have recently improved a scheme that I have now fully automated in my portfolio spreadsheet. Instead of obsessing over my portfolio’s returns, a script emails me when I need to rebalance.

Investors should use any new savings or withdrawals they make as opportunities to rebalance by buying low asset classes or selling high ones. However, as a portfolio grows, rebalancing with new savings and withdrawals is unlikely to be enough to maintain balance when asset classes have big swings.

Common advice is to rebalance a portfolio on a fixed schedule, such as yearly. This has the advantage of allowing investors to avoid obsessing over their portfolios all the time, but has the disadvantage of missing potentially profitable opportunities to rebalance. Computing thresholds automatically in a spreadsheet permits me to ignore my portfolio unless my script emails me. This gives me the advantages of threshold rebalancing without the disadvantage of constant monitoring.

When choosing rebalancing thresholds, most experts advise investors to either use percentage thresholds or dollar amount thresholds. For example, you might rebalance whenever you’re off target by more than 5%, or alternatively by more than $2000. However, these approaches don’t work for all portfolio sizes. Percentage thresholds lead to pointless rebalancing in small portfolios, and dollar amount thresholds lead to hourly trading in very large portfolios. We need something between these two approaches.

Computing Thresholds

When asset class A rises relative to asset class B, and then A drops back down again to the original level relative to B, rebalancing produces a profit over just holding. I compute rebalancing thresholds based on the idea that the expected profit from rebalancing should be 20 times the ETF trading costs.

All the mathematical details of how I compute rebalancing thresholds are in the updated paper Portfolio Rebalancing Strategy. I’ll just give the results here.

I have a sub-portfolio with 3 U.S. ETFs. To keep them in balance relative to each other, the spreadsheet starts by computing the following quantities for each ETF:

m – Current portfolio total value times the target allocation percentage. This is the target dollar amount for this ETF.
s – Bid-ask spread divided by the ETF share price.

Other parameters are

c – Trading commission.
f – Desired ratio of trading costs to expected profits. I use 0.05 so that the expected profits from rebalancing are 20 times the trading costs.

The dollar amount threshold for rebalancing then works out to the following formula which may seem a little intimidating, but it only has to go into a spreadsheet once.

t = (m/(2f)) * (s + sqrt(s*s + 8*f*c/m)).

So, it makes sense to rebalance an asset class if its dollar level is below m-t or above m+t. As long as there are at least two asset classes far enough out of balance (with at least one too high and at least one too low), it makes sense to rebalance.

This method works fairly well when the target allocation percentages are close enough to equal. The new part of this work that I completed recently is a more accurate method when there are only two asset classes, but their allocation percentages aren’t necessarily close to equal.

This applies to my case in two ways. I view my stocks as a sub-portfolio with one part denominated in Canadian dollars (30%) and one part denominated in U.S. dollars (70%). The U.S. part contains the 3 U.S. ETFs I mentioned earlier. One level above this, I view my overall portfolio as one part stocks (currently about 80%) and one part bonds (currently about 20%). This bond percentage will rise as I get further into retirement.

The new method for two asset classes looks remarkably similar to the old method. Consider the case of stock/bond rebalancing. Let m be the target dollar amount for stocks and b be the target dollar amount for bonds. Let m’ be the harmonic mean of m and b:

m’ = 2/(1/m + 1/b).

Then the formula for the threshold dollar amount is the same as the earlier formula, except that we replace m with m’:

t = (m’/(2f)) * (s + sqrt(s*s + 8*f*c/m’)).

If the stocks and bonds get further away from their target amounts by more than t, then it’s time to rebalance. The full paper gives further details on how the commission amount c and the bid-ask spread s should be adjusted in cases where extra trading is required, such as when rebalancing involves currency exchange with Norbert’s Gambit.

The difference between this two-asset class method and the earlier method is that the new method gives a lower threshold. The old method would give a very low threshold for the asset class with the smaller target percentage, but a high threshold for the other asset class. But we only rebalance when both thresholds are met. So, the higher threshold dominates. The new more accurate method gives a lower overall threshold, so that we can better take advantage of rebalancing opportunities.

Conclusion

It took me a while to work all this out, but now I don’t have to pay much attention to my portfolio. When I have some money to add, I buy the asset class that my spreadsheet says is furthest below its allocation, and occasionally I get an email telling me to rebalance.

Many readers have asked for a generic version of my portfolio spreadsheet, and I’ve tried to produce one a number of times. But, it’s difficult to make it general enough to be useful. I’m happy to answer questions for those looking to create their own spreadsheets, but I’m unlikely to produce a generic version to work from.

12 comments:

  1. Michael, I love the in-depth analysis of this post. Posts like these are why I started and continue to follow your blog. It will take me awhile to chew through, but I intend to attempt to make use of this.

    I have skimmed the full paper, but haven't read it in depth. So if the answer is in there, feel free to just redirect me (I don't want you to rewrite your paper in the comments!).

    One tricky part of all this seems to be in choosing the "correct" value of 'f'. Why not set it much higher, like 0.5? I'm sure using a value like this would have you trading non-stop all day every day. This is perhaps an extreme example where conditions might change so fast underfoot that by the time you executed the trade, the conditions leading to attempt the trade no longer held by the time the trade was executed.

    But let's assume rapid market changes aren't a factor. Why not settle for less of a profit per trade?

    My own thinking on this leads me to think that overall profitability of rebalancing depends on the sequence of trades on a particular holding. If this rebalancing causes you to buy, sell, buy, sell, etc, you are making a certain profit each time. But if you buy, buy, buy on one holding and sell, sell, sell on another, then these trades represent lost gains.

    The value in these "losing" trades is keeping your relative risk profile in check. But if the risk was only drifting by a couple of tenths of a percent each time, there probably isn't a lot of value. Fixed thresholds probably do a reasonable job of achieving this aspect of risk management?

    Of course, we can't really come up with a forumla to tell trade at the right time to get the magic buy/sell/buy/sell sequence of trades that profit every time. That's what active investors try to do, but usually fail at.

    I do think there is value in this line of thinking, but this aspect still has be scratching my head a bit. Do you have any thoughts in this area to help colour my thinking?

    Thanks for sharing this work!

    ReplyDelete
    Replies
    1. Hi Returns Reaper,

      You make some excellent observations, particularly about the disadvantages of rebalancing in the same direction multiple times in a row.

      My first answer to why not use f=0.5 is that threshold rebalancing often gets triggered during market turmoil, a time when spreads are unusually high and spread costs in trading are high. I tend to think of the spread fraction s as a fixed value (different for each ETF based on its typical spread). But s actually fluctuates, so I use a low f as a safety margin against the possibility of unprofitable rebalancing trades when spreads are high.

      Another fact to consider is that rebalancing profit is proportional to r*r, which is proportional to somewhere between 1/f and 1/(f*f). So, if you increase f by a factor of 10, rebalancing profit decreases by a factor of between 10 and 100. So, setting f high leads to picking up nickels at a modest profit.

      I don't have any justification for the particular choice of f=1/20 other than a gut feel. I'm confident it is reasonably safe, but I can't say whether it is better than f=1/10 or f=1/40.

      It's important to keep in mind that the main purpose of rebalancing is to control risk. Although I've framed the choice of rebalancing thresholds in terms of profits, my real motivation was to have thresholds high enough to avoid trading losses, but low enough to stay reasonably close to balanced.

      I'm not sure of exactly what you're asking with "Fixed thresholds probably do a reasonable job of achieving this aspect of risk management?" Some people think of fixed thresholds as fixed percentages. The risk here is for those with small portfolios trading too often and losing on commissions. Some people think of fixed thresholds as fixed dollar amounts. The risk here is for those with large portfolios trading too often and losing on spreads.

      I've seen some evidence of those with extensive experience with rebalancing saying to use certain percentages, but use wider percentages for small accounts. This is kind of a hand-wavy version of what I've formalized with some math.

      Delete
  2. Interesting as always, Michael. I just wonder if in a taxable account, would you consider the capital gain tax you might have to pay in selling a too-high holding in the rebalancing cost calculation?

    ReplyDelete
    Replies
    1. Anonymous: Because I view the collection of accounts by wife and I have as a single portfolio, I'm able to find a way to rebalance without selling stocks within taxable accounts (or at least that's been true so far). But you're right that all costs count. If you're considering rebalancing and it would trigger capital gains taxes, that cost matters.

      Delete
  3. This is an awesome post, and thank you. Can you share anything about how you are live-capturing bid-ask spreads? Today I am (trying to) do this using a Google Docs sheet that scraps Bid-Ask from Yahoo Finance!, but I am finding this method not reliable.

    ReplyDelete
    Replies
    1. Anonymous: I haven't found a reliable way to live-capture the spreads. I sampled them many times and a few times and choose a slightly above-average value. I've also found average figures online. So, I just have static values. This is part of why I use f=5%; I don't want to start making unprofitable trades when the market is volatile and spreads are high. I check the spreads before making a trade as well. The other reason for a lower f is that higher values lead to a lot of low-profit trades, which just wastes my time.

      Delete
    2. Thanks for the quick reply. Maybe I should just resort to averages too, I'm probably going a bit too Captain Ahab trying to get this thing to work for too long. Just irks me now that I can't figure it out. :) I just feel like I'd have to check more regularly because I use more TSX-listed funds than you do (I think) and I find some of the spreads tend to be a bit larger in these than the big, liquid US funds like VTI, etc. Perhaps as you say I just compensate for this with a bigger f. (but then having an elaborate formula and slapping a huge fudge-factor constant in front of it is also offending my inner mathematical purist)

      I should go back to work now.

      Delete
    3. Anonymous: The critical thing with rebalancing is to avoid the zones where you're trading for net losses or completely missing profitable trades. The acceptable range is very wide.

      Delete
  4. Hi Michael, I thought I'd report back that I've finally spent the time to add the rebalancing logic from your paper into my spreadsheet, then wrote a script to check once per day and email me if rebalancing is required.

    I was actually surprised at how easy it was. I wasn't aware of google sheets' GOOGLEFINANCE() macro, which makes getting current prices dead simple.

    It would be nice if there was some way to automatically get my sheet to query my account to get up-to-date cash balances, but I can't think of a way of storing credentials that wouldn't invalidate terms with my bank. As it is now, I just maintain number of shares of each holding (update each time I make a trade) and either when it is time to rebalance or every few months I update my cash position manually.

    I'm sure its possible to automatically update my spreadsheet when funds distribute dividends, and I could also account for my automatic contributions. I'm not sure it is worth the effort however.

    I had also never before written any kind of google sheets script, and was impressed at how simple it was to poll the spreadsheet and send an email.

    It's very nice having all of this in place. I'm sure I missed some rebalance opportunities with the recent volatility, which is a shame. But it's nice that I'm setup to not miss future opportunities.

    Thanks for the legwork you put into making this publicly available.

    ReplyDelete
    Replies
    1. Hi Returns Reaper,

      You're welcome. I just manually update cash levels as well. Your setup sounds very similar to mine.

      Delete
    2. Not sure which broker you use but Questrade actually has a read-only API that allows you to pull your account data directly from them with your own hand-code. I haven't tried to figure out how to work it yet and not sure if other brokers offer anything similar. Google Questrade API.

      Delete
    3. Anonymous: Cool. If this COVID-19 isolation thing extends into the fall and winter, I might be tempted to switch from Investorline to Questrade just so I'll having something to do with my spreadsheet. I suppose I should check if this sort of thing exists for Investorline.

      Delete