Ever tried to calculate your investment returns only to get tangled up when money goes in and out at different times? You’re not alone. At QuantMage, we’ve been grappling with this exact issue. Initially, we switched from Principle-First Withdrawal to Pro-Rata Withdrawal (PRW) to compute cost bases or net contributions. Once you have the cost basis number, the return can just become the current valuation over it minus one. The idea was to avoid negative cost bases that can crop up with large withdrawals, making returns look nonsensical.
But truth be told, PRW still left us scratching our heads. It had some unintuitive quirks and suffered the asymmetrical dilution when you make additional contributions—a problem I mentioned in the previous post. Then, I stumbled upon a paper introducing a new method: Cash-Flow Weighted Return (CFWR). This approach for measuring average multi-period returns with intermediate cash flows and varying periodic returns was a game-changer. We loved it so much that we decided to adopt CFWR for calculating all-time returns at QuantMage. Let me walk you through why this new technique might just make your financial life a whole lot clearer.
What Makes a Good Return Measure?
When you’re dealing with contributions and withdrawals, measuring investment returns isn’t as straightforward as it seems. If you’re solely interested in the pure performance of an investment strategy without any cash flows, Time-Weighted Return is your go-to metric. That’s what we use at QuantMage for charts and stats per spell.
But if you want to factor in cash flows and the time value of them, options like Modified Dietz (MD), Money-Weighted Return (MWR) (also known as Internal Rate of Return), or the new CFWR come into play. To figure out which method works best, we need some criteria. The paper I mentioned outlines five attributes of good return measures, but let’s focus on two key ones:
i) Consistency with Net Gain or Loss: The sign of the average return measure should be consistent with the net gain or loss of the multi-period investment.
iii) Independence from Cash Flow Timing under Constant Periodic Returns: When periodic returns are constant over the investment horizon, the return measure must equal this constant number regardless of how the magnitude or sign of periodic investment cash flows vary.
Unfortunately, our previous approach, PRW, doesn’t tick these boxes. Let me show you why with a couple of examples.
Example 1: The Negative Return Paradox
Initial Investment: You deposit $100.
Growth: It gains 100% and grows to $200.
Withdrawal: You take out $150, leaving you with $50.
Loss: The remaining amount drops by 80%, leaving you with $10.
Your net gain is still positive at $60 ($10 remaining + $150 withdrawn - $100 initial investment). But PRW calculates your return as -60%. That’s because PRW uses the formula (10 / 25 - 1) * 100, which doesn’t align with your actual gain—violating our first criterion.
Example 2: The Overstated Return
Initial Investment: You deposit $100.
Growth: It gains 100% to reach $200 after one year.
Additional Investment: You add another $100, bringing the total to $300.
Further Growth: It gains another 100% over the next year, reaching $600.
Both one-year periods had a return of +100%, but PRW calculates your overall return as +200% (= (600 / 200 - 1) * 100), which doesn’t make sense and violates the third criterion.
Modified Dietz (MD) also falls short on these criteria. Money-Weighted Return (MWR) passes both tests but lacks an analytical solution and has other shortcomings compared to CFWR, which we’ll explore next.
Introducing Cash-Flow Weighted Return
So, how does CFWR work? Here’s the formula (don’t worry—we’ll break it down):
There are N periods 1...N, with 0 defined as the beginning of period 1. CFt is the cash flow at the beginning of period t+1, with deposits to the investment account treated as positive and withdrawals from the account as negative. rt,GM is the geometric mean return for periods t…N. At first glance, it might look intimidating, but stick with me. Think of CFWR as a weighted harmonic mean of each period’s geometric mean return (rt,GM). Why use the harmonic mean? In cases involving rates and ratios—like investment returns—the harmonic mean often gives a more accurate average than the arithmetic or geometric means.
The weights in this formula are essentially the returns from each cash flow, which is why it’s called Cash-Flow Weighted Return. Another way to look at it is:
Numerator: Your net gain or loss over the investment horizon.
Denominator: The sum of amounts invested at the beginning of each period, each compounded at its applicable geometric mean return.
I know—that’s a lot to digest. It took me a while to wrap my head around it, too. But the key point is that CFWR satisfies our two main criteria:
i) Consistency with Net Gain or Loss: Since the numerator represents your actual net gain or loss and the denominator is always positive, the sign of the CFWR will always match your real investment performance.
iii) Independence from Cash Flow Timing under Constant Periodic Returns: If the returns are constant across periods, given the harmonic mean interpretation, the CFWR will equal that constant return, no matter how much you invest or withdraw during those times.
Compared to MWR, CFWR is easier to compute as long as you have the return data for each period. Unlike MWR, which requires solving for the rate that sets the net present value of cash flows to zero (a process that can be complex and doesn’t always yield a unique solution), CFWR provides a direct calculation. Plus, it allows you to see how each individual cash flow contributes to your overall return in an intuitive way, by compounding each cash flow at the geometric mean return applicable for that cash flow based on returns that are subsequent to that cash flow, while MWR compounds all of them by a fixed rate.
Wrapping Up
It’s surprising how complicated and nuanced calculating investment returns can get when you’re moving money in and out, isn’t it? No wonder most brokerage apps shy away from showing your all-time return—it often ends up being more confusing than helpful.
At QuantMage, we’ve now switched to reporting all-time returns using CFWR for both the entire portfolio and individual spells. We’ve also decided to stop showing net contribution (cost basis) numbers, as CFWR provides a clearer and more accurate picture.
So, what do you think? Have you faced similar challenges in measuring your investment returns? Which method resonates with you the most? I’d love to hear your thoughts!
Not critical but a possible satisfying feature would be to allow users to toggle between different return metrics. E.g. currently, due to a recent deposit, I'm up 3% TWR while up 89% in CWFR. I'm very glad that CWFR is the primary metric (since it's more insightful + TWR is easy to calculate) but I can imagine situations where a user might want multiple ways to evaluate their performance. Just a thought...
Love the change. I'm always frustrated with with how difficult it is to track performance at brokers across strategies. Again and again, your attention to detail amazes me. Whenever, I want some feature (or often before I even know I want it), I find you implementing it at QM. I admire how carefully and deeply you think about your product.