Understanding Time-Weighted Returns

Why time-weighted return (TWR) is the right way to measure portfolio performance, and how AlphaLens calculates it across your Alpaca and IBKR accounts.

Chris ReynoldsChris Reynolds
March 12, 20262 min read
ShareTwitterLinkedIn

The problem with simple returns

Suppose you started the year with $100,000. In March you deposited another $50,000 — excellent timing, as the market was near its lows. By December your account is worth $180,000.

A naive calculation would say you made 80%. But that ignores the fact that most of those gains came from capital you added in March, not from your investment skill.

Time-weighted return (TWR) solves this by neutralizing the effect of cash flows, measuring only the performance of the investment strategy itself.

How TWR works

TWR chains together the returns of each sub-period between cash flows:

code
TWR = (1 + R₁) × (1 + R₂) × ... × (1 + Rₙ) - 1

Each sub-period return Rᵢ is calculated on the portfolio value before any deposit or withdrawal occurs in that period. The result is a return that reflects your strategy's performance independent of when you added or removed money.

This is the same methodology used by professional fund managers and required by the CFA Institute's Global Investment Performance Standards (GIPS).

How AlphaLens calculates TWR

Alpaca

Alpaca's portfolio history endpoint returns a profit_loss_pct series that is already adjusted for cash flows — it is the cumulative TWR series. AlphaLens uses it directly.

Interactive Brokers

IBKR's Performance Analytics API (/pa/performance) returns a Cumulative Performance Series (CPS), which is their implementation of TWR. AlphaLens reads the CPS values directly, treating them as equivalent to Alpaca's profit_loss_pct.

Multi-account merging

When you have accounts at multiple brokers, AlphaLens merges the return series by averaging on overlapping dates and carrying forward the last known value on non-overlapping dates. This gives you a single blended curve that represents your combined portfolio.

TWR vs. money-weighted return

TWRMWR (IRR)
Adjusts for cash flowsYesNo
Measures manager skillYesNo
Shows actual dollar outcomeNoYes
Required by GIPSYesNo

AlphaLens shows you both. TWR is the primary chart; IRR is available in the metrics panel so you can see your actual dollar-weighted outcome.

Why this matters for you

If you regularly contribute to your investment account — which most people do — TWR is the only fair way to compare your returns against a benchmark like SPY. AlphaLens always uses TWR for benchmark comparisons so you're measuring apples to apples.

Newsletter

Trader-grade analytics, in your inbox

One short email when we publish a new piece on portfolio analytics, risk metrics, or broker integrations. No spam, no auto-DRIPs.