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.
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:
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
| TWR | MWR (IRR) | |
|---|---|---|
| Adjusts for cash flows | Yes | No |
| Measures manager skill | Yes | No |
| Shows actual dollar outcome | No | Yes |
| Required by GIPS | Yes | No |
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.
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.
Keep reading
Related postsWhy Your Broker's Return Number Is Misleading
The percentage your broker shows you is almost never your actual return. Here's what it's actually measuring — and what you should look at instead.
What Is a Good Sharpe Ratio for a Retail Investor?
The Sharpe ratio measures return per unit of risk. Here's what the numbers actually mean for a retail portfolio — and why most traders have no idea what theirs is.
Max Drawdown Explained: What It Is and Why It Matters More Than Returns
Max drawdown tells you the worst loss you would have experienced holding a portfolio. It's often a better measure of risk than volatility — and most retail investors never track it.
