Time-Weighted Return (TWR)
The Time-Weighted Return (TWR) is a measure that evaluates the performance of an investment portfolio regardless of its associated cash flows. Rather than accounting for the money added or withdrawn during the period, the TWR estimates the portfolio's return as if it had remained untouched throughout that period. In essence, it nullifies the impact of contributions and redemptions, enabling a more accurate comparison of performance across investment strategies, time frames and benchmarks. To evaluate the financial return actually obtained by the investor, taking into account the size and timing of each contribution and redemption, the Internal Rate of Return (IRR) is more appropriate.
To learn more about the differences between TWR and IRR, visit https://gorila.com.br/blog/tir-cotizacao.
How it is calculated
This is a simplified explanation that covers the general case. Specific situations, such as position reversals, day trades and derivatives, are not detailed here.
The TWR is calculated in two steps:
-
Daily return: the day's profit or loss (P&L), already net of transaction costs, is divided by the adjusted opening market value. This base is the market value at the previous day's close, plus the day's purchases and incoming custody transfers (minus outgoing transfers), and adjusted for events such as splits, reverse splits and stock bonuses. Sales and income do not change the base, since they go into the P&L. That way, a contribution is not mistaken for a gain. For example, if the portfolio closed the previous day worth BRL 5,854.00 and BRL 8,880.00 in stocks were bought today, the day's base is BRL 14,734.00. If the portfolio closes the day worth BRL 14,800.00, the day's return is BRL 66.00 ÷ BRL 14,734.00 ≈ 0.45%.
-
Compounding: the daily returns are chained over the period, where is the return of day :
For example, daily returns of +2%, −1% and +3% result in a TWR of 1.02 × 0.99 × 1.03 − 1 ≈ 4.01% for the period.
Example: TWR and contributions
A portfolio starts with BRL 10,000.00 and yields 10%, reaching BRL 11,000.00. At that point, the investor contributes BRL 89,000.00, and the portfolio is now worth BRL 100,000.00. It then falls 5% and ends at BRL 95,000.00.
- TWR: 1.10 × 0.95 − 1 = +4.5%. The investments' performance was positive, regardless of the size of the contribution.
- P&L: a gain of BRL 1,000.00, followed by a loss of BRL 5,000.00, totaling −BRL 4,000.00. Since the drop happened when much more money was invested, the investor lost money.
That is why the TWR is the right measure to evaluate and compare a portfolio's performance, while the P&L and the IRR show the investor's financial result.
Return basis (type)
The type parameter defines the return basis used in the calculation:
GROSS_UP(default): besides deducting transaction costs, it adjusts upward (gross-up) the income of tax-incentivized securities that are exempt from income tax (such as LCI, LCA and incentivized debentures). The result of these securities is divided by 0.85, which is equivalent to the yield of a security taxed at 15%. That way, exempt and taxed securities become comparable.GROSS: deducts transaction costs, without the gross-up adjustment.
In neither case are taxes on gains deducted.
Period, frequency and series type
- Period (
startDateandendDate): the TWR is accumulated fromstartDate, including that day's return. WhenstartDateis not informed, the calculation starts at the portfolio's inception. - Frequency (
frequency): defines the granularity of the series points:DAILY,MONTHLY,YEARLYorINTERVAL(a single point for the whole period). - Series type (
seriesType): withACCUMULATED, each point shows the TWR accumulated fromstartDateup to that date. WithPER_PERIOD, each point shows only the return of its own period (the day, month or year). - Interval: besides the series, the response includes the
intervalfield, with the TWR for the whole queried period.
Values are returned in decimal format: 0.045 means 4.5%.
Derivatives and exposure
In portfolios with futures and forwards, the return can be calculated from the wealth or the exposure perspective, through the marketValueType parameter. See Exposure.
Where to access
In GorilaCORE, the TWR is available through the following endpoints:
- Read Time-Weighted Return: time series of a portfolio's TWR, with a choice of frequency and series type.
- List Position Time-Weighted Returns: TWR of each position of the portfolio for the period, with the option to group the result (
groupBy) by broker, security, security type, asset class or classification level. - Read Economic Group Time-Weighted Return and List Economic Group Positions Time-Weighted Returns: the same views for an economic group.
The endpoints allow filtering by security, asset class, security type, classification and broker, providing a tailored view of the portfolio's performance.
You can also calculate the TWR of an isolated security, outside the context of a portfolio; see Security Metrics. To measure how far the return has fallen from its highest point, see Drawdown.