A dollar-weighted return measures investment performance while accounting for the timing and amount of deposits and withdrawals. It is useful when the investor’s cash-flow decisions affect the result. section 7.0 section 7.1
A two-deposit investment
Suppose an investor deposits 10, deposits another 10 one year later, and liquidates the position for 19.8 after two years. The dollar-weighted return solves 0 = 10 + 10/(1+r) − 19.8/(1+r)^2, producing an IRR of about −0.66%. The negative result reflects that the weaker return occurred after the account became larger. section 7.1 section 7.1.2
The calculation is analogous to an internal-rate-of-return calculation: find the single rate that makes the net present value of dated cash flows equal zero. Deposits and withdrawals receive their actual signs, while the final liquidation value uses the opposite sign from deposits. section 7.1.2
Listing 7.2 General solution for the dollar-weighted return
from datetime import datetime
cashflows = [10, 10, -19.8]
dates = ['2020-01-01', '2021-01-01', '2022-01-01']
dates = [datetime.strptime(dt, '%Y-%m-%d') for dt in dates] #1
def f(x, *args):
cashflows, dates = args
sumPVs = 0
for i in range(len(cashflows)):
Y = (dates[i] - dates[0]).days/365 #2
sumPVs += cashflows[i]/(1+x)**Y
return sumPVs
root = fsolve(f, 0, args=(cashflows, dates)) #3
print('The Dollar-Weighted Return is ', root.item())
Generalizes the calculation with arbitrary cash flows and dates, converts YYYY-mm-dd strings to dates, discounts using elapsed days over 365, and solves with SciPy’s fsolve. section 7.1.2
Use the result with the choice of performance question in mind:
- Compare it with a time-weighted return when deposits and withdrawals make the two measures diverge. section 7.3
- Treat it as a measure of the investor’s dollar experience, especially when the timing of investment decisions matters. section 7.3
