Skip to main content

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:

  1. 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%.

  2. Compounding: the daily returns are chained over the period, where rir_i is the return of day ii:

TWR=(1+r1)×(1+r2)×⋯×(1+rn)−1\text{TWR} = (1 + r_1) \times (1 + r_2) \times \dots \times (1 + r_n) - 1

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 (startDate and endDate): the TWR is accumulated from startDate, including that day's return. When startDate is not informed, the calculation starts at the portfolio's inception.
  • Frequency (frequency): defines the granularity of the series points: DAILY, MONTHLY, YEARLY or INTERVAL (a single point for the whole period).
  • Series type (seriesType): with ACCUMULATED, each point shows the TWR accumulated from startDate up to that date. With PER_PERIOD, each point shows only the return of its own period (the day, month or year).
  • Interval: besides the series, the response includes the interval field, 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:

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.