# How do I calculate the performance of a stock investment in the presence of dividends, additional investment and partial sales?

What is a single metric I can use to calculate the performance of a stock investment in the presence of dividends, additional investment, and partial sales? Such a metric should be comparable across all my other stock investments.

Compounded annual growth rate (CAGR) would be suitable if I bought a non-dividend-paying stock in one shot, and later sold it completely in one shot. However, CAGR may not be suitable if the stock pays cash dividends (which I may or may not choose to reinvest), or if I buy more shares of the stock on another day, or if I later reduce my holdings of the stock without selling all my shares.

I thought about using the yield-to-maturity (YTM) metric that is commonly used for bonds since it is able to handle multiple inflows (initial investment, additional investment), multiple outflows (dividends, partial sales), and makes no assumption about reinvestment . When plugging in the numbers into the YTM formula, I will simply assume that I am now selling all my shares of the stock at its current market price. Is this a sound method? Are there other suitable metrics?

• – Flux
Sep 21, 2022 at 13:48

There are two metrics that are commonly used.

First is time-weighted rate of return. You calculate it for each day, separately. It tells essentially if you reset your investment such that you have \$1 in the beginning of the day, what would you have at the end of the day. For example 3% time-weighted rate of return in one day means you would have \$1.03 at the end of the day.

Time-weighted rate of return is multiplicative. Example: if one day yields 1%, another 2%, third 3% and fourth 4% then the total return is `1.01*1.02*1.03*1.04 = 1.10355024` or 10.355024%. Not additive in which case the total return would be exactly 10%.

The main difficulty of using time-weighted rate of return is that you have to have the price information for all stocks you hold for each day. In theory, you could skip some days and use only days when something happens (such as you buying or selling a stock or dividends being paid).

Another is money-weighted rate of return. In gives one number, an average annual return for the period for which you did your investment.

It works like this. For every day (`d = 1, 2, 3, ...`) when something happened, you calculate `y_d`, the number of years from the start of the investment and `F_d`, the flow of cash into or out of your portfolio (where cash in is negative and cash out is positive). Then for end of investment you calculate `y_end` which is number of years from start of investment, and `F_end`, which is the current value of your portfolio.

Then you find r such that

``````F_1/(1+r)^y_1 + F_2/(1+r)^y_2 + F_3/(1+r)^y_3 + ... + F_end/(1+r)^y_end = 0
``````

Money-weighted rate of return is as the name says, weighted by money. So for example if you invest \$1 for 10 years, then at the end of the 10 years invest \$99999 more and wait for another 10 years, money-weighted rate of return tells principally about the period where you had \$100000 invested and practically nothing about the period where you had \$1 investment. Time-weighted rate of return considers both periods equivalently important.

I use money-weighted rate of return for my stock investments because I don't have enough historical price information for all ~100 stocks in my portfolio.

Just for fun, I also import regularly information from a global stock total return index and calculate time-weighted rate of return of the index for the period for which I had calculated the money-weighted rate of return. Then I compare this time-weighted index rate of return into a hypothetical money-weighted index rate of return that tells how my investments would have performed without active stock choosing just by investing into the index (this hypothetical money-weighted rate of return has all cash flows being the same as with my real portfolio, with the exception of the current value of the portfolio which is calculated based on the index). The difference tells how well I have timed my stock investments into market lows. Currently the time-weighted index rate of return is about 1% lower than the money-weighted index rate of return, telling that I have succeeded in timing the market.

A nice feature of time-weighted rate of return is that you can draw a chart out of it. Money-weighted rate of return, being just one number for the whole investment period, cannot be charted.

• How does money-weighted rate of return differ from yield to maturity (YTM) and internal rate of return (IRR)?
– Flux
Aug 16, 2022 at 5:01
• IRR is a variety of money-weighted rate of return, but it is not the only one: the modified Dietz method is also a form of money-weighted return, albeit an approximation, easier to calculate than IRR (not requiring a solver). Aug 16, 2022 at 8:40