How to fill in the form
- Start — the date and the amount in the account on that day. The calculator treats it as your first contribution.
- Deposits and withdrawals — one row per operation: the date, the amount (a withdrawal with a minus sign) and the account value right before the operation, excluding its amount. Rows can be added and removed, up to 50 in total; a row with a zero amount is simply the account value on that date.
- End — the date and the account value with open positions at the current price.
Dates go in order and values must be above zero. Dividends and coupons left in the account are income, not deposits; fees are not entered separately — they are already in the account value.
How the calculator works
- TWR (time-weighted return):
TWR = (1 + r₁) × … × (1 + rₙ) − 1, whererᵢis the return of the sub-period between operations: the value before the next operation over the value after the previous one. Per year —(1 + TWR)^(365 / days) − 1, and only for a term of 365 days or more: +3% in two weeks would annualize to 116%, which is compounding arithmetic, not a return. - XIRR (money-weighted return, MWR) is the rate r at which
Σ Flowₖ / (1 + r)^(daysₖ / 365) = 0: the start and deposits enter with a minus sign, withdrawals and the final value with a plus sign. Days are divided by 365, and the equation is solved by Newton's method starting at 10%, like the XIRR function in Excel. If it does not converge (Excel then returns #NUM!), the calculator finds the root by bisection — halving the interval. The example from Microsoft's help — a 10,000 investment and four payments from March 2008 to April 2009 — gives 37.34%, the same as the help. You can cross-check in a spreadsheet with the template from «Investment tracking: spreadsheet or service». «Start vs end» = (End − Start) / Start,Profit = End − (Start + deposits) + withdrawals.
Check it against the article
The calculator opens with the example from «Portfolio return with deposits: TWR and XIRR explained»: 10,000 on January 1, 11,000 by July 1 plus a 5,000 deposit, 15,200 by year end (in the form — January 1 of the next year, exactly 365 days). The result is TWR +4.50%, XIRR +1.60% per year, «start vs end» +52% and a profit of 200. Enter 9,000 before the deposit and 15,400 at the end to get the second example: TWR −1.00% and XIRR +3.20%. Why they differ and which return to look at is covered in the article.
How Davinchu calculates it
In the calculator you have to find and enter the value before each operation yourself. In Davinchu a portfolio in «Investments» records its value every hour, and TWR is calculated from these snapshots: a deposit, a purchase with new money or an imported position is a cash flow, not income. The «Overview» tab shows «TWR return» and «XIRR / MWR» side by side — XIRR appears once the portfolio has 30 days of history. The «Analytics» tab adds monthly returns and a benchmark comparison (BTC, ETH or 60/40 BTC-ETH), and the «Investor report» shows both returns with the methodology and downloads as a PDF. «Investments» is on every plan — more on the «Davinchu for stock investors» page.
For trading accounts, «Growth» in account analytics is compounded by year: deposits and withdrawals are not counted as profit, and a withdrawal does not reduce the base. The Free plan connects two accounts at no cost.