Skip to content
All library documents

Portfolio Returns with Monthly Rebalancing and Path Dependence

Article Quant Q&A · Author: user3595632

Summary

The document discusses how to calculate a portfolio’s cumulative return from asset prices and weights that change monthly. It distinguishes a portfolio rebalanced to target weights every day from one whose holdings are allowed to drift between monthly rebalances. With daily rebalancing, daily portfolio returns can be calculated as the weighted sum of asset returns, then compounded over time. The weight timing convention matters: weights recorded at day end may need to be shifted to represent the holdings used during that day.

When a portfolio is rebalanced only monthly, asset weights evolve with each asset’s returns between rebalances, so applying the unchanged target weights to every day’s return does not describe the actual holdings. The answers emphasize path dependence and the need to specify whether weights are measured at the beginning or end of each period. They do not provide a full implementation for monthly holdings drift or address transaction costs, corporate actions, or other backtest assumptions.

Key ideas

  • Calculate asset returns from consecutive prices before combining them into portfolio returns.
  • Daily rebalancing supports a weighted sum of daily asset returns followed by compounding.
  • Weights that change monthly drift between rebalances as their assets earn different returns.
  • Specify whether portfolio weights apply at the beginning or end of each day and align the data accordingly.

Tags

Full text
# How to calculate "portfolio cumulative return" from individual price data and weight of them?


# How to calculate "portfolio cumulative return" from individual price data and weight of them?












I'm trying to run backtest in a vectorized way using `Python Pandas` and need to calculate a portfolio cumulative return from price data and weight of asset data.

I have two `Dataframes`:

- price of each individual assets (https://www.dropbox.com/s/ve9ll3t1j5owfuc/test_price.csv?dl=0)

- weight of each individual assets (https://www.dropbox.com/s/hto9kq2g2wwfpm8/test_weight.csv?dl=0)

- Both Dataframe has same shape

- Weights of each assets change only at the end of month Weights of the rest of days are filled by 'ffill' method, so weights are all same during the each month

What I have found out:

- `portfolio_cum_rtn_df = (price_df.pct_change().fillna(0) + 1).multiply(weight_df).sum(axis=1)`

- `portfolio_rtn_df = price_df.pct_change().fillna(0).multiply(weight_df).sum(axis=1)` `portfolio_cum_rtn_df = (portfolio_rtn_df + 1).cumprod()`

Both are not correct way to calculate portfolio cumulative return.

Need some helps

## Answer by mperlow (score 4, accepted)

https://quant.stackexchange.com/a/42023

These answers are missing the idea of path dependency. Your weights are only updated monthly. That means your weight on t0 is w0 and weight on t1 is w0*(1 + r1), weight on t2 is w0*(1+r1)*(1+r2) where r(i) is the split adjusted total return on day i. I imagine you are keeping it simple, but it also matters if you are assuming your weights are beginning of day or end of day.

If you are assuming a daily rebal to the weights in your sheet, then you can forget about path dependency because weights are provided at each discrete time-step. If this is the case, your second formula is correct (slight edit below), but again the devil is in the details. It matters if your weights are assumed at the beginning or end of day. If end of day, you need to shift one day forward to get the intended beginning of day weights for simulation. If you are only trading once per month, your formula isn't correct - you need to incorporate path dependency.

```
portfolio_rtn_df = weight_df.multiply(price_df.pct_change().fillna(0)).sum(axis=1)
portfolio_cum_rtn_df = (1 + portfolio_rtn_df).cumprod() - 1
```

## Answer by DeltaZen (score 1)

https://quant.stackexchange.com/a/42016

Assume assets $a$, $b$, $c$ with weight $W$ and price $P$.

On day $i$, the return of asset $a$ is $R_{a}(i) = P_{a}(i)/P_{a}(i-1) - 1$.

Portfolio return $R_{p}(i)$ on day $i$ equals $W_{a}(i) \cdot R_{a}(i) + W_{b}(i) \cdot R_{b}(i) + W_{c}(i) \cdot R_{c}(i)$,

then portfolio cumulative return is $\Pi (1 + Rp(i)) - 1$, for $i$ from 1 to day end.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.