Why Two Rebalancing Conventions Produce Different Trading P&L
Summary
The document compares two ways to account for a target-holdings rule: liquidating to zero and rebuilding the position at each date, or first marking the existing position to the new price and then trading to the target. A small price path and a signal that sets holdings equal to price produce different cash totals under these conventions. The example highlights that trades and investment returns occur at distinct points in the accounting sequence.
The key modeling issue is the assumed execution and valuation timing. Resetting at the current price discards the gains or losses earned while carrying the prior position from the previous price; the second method explicitly records that mark-to-market change before rebalancing. The example therefore illustrates why a backtest must define when signals are observed, when target holdings take effect, and which price is used for trades. It assumes frictionless trading and does not discuss whether the signal is known before the price move, nor does it establish a preferred convention for every strategy.
Key ideas
- A holdings target and a profit calculation require an explicit timing convention.
- Marking existing positions to market captures price changes earned before rebalancing.
- Resetting holdings at each date can omit the prior position’s interim gains or losses.
- A backtest should align signal availability, valuation, and trade execution assumptions.
Tags
Full text
# 2 ways to calculate profits, which both seem legit, but produce different results - what am I missing? # 2 ways to calculate profits, which both seem legit, but produce different results - what am I missing? I'm trying to calculate this simple example with 2 ways which both seem legit, and getting different results. Way 1: at the beginning of day $t$, first reset the holdings to 0, then buy the number of holdings you should buy (given a signal). Way 2: at the beginning of day $t$, calculate the profits given the holdings and today's price, then adjust the holdings to today's signal. I assume lab conditions: zero transaction costs, no friction, etc. I will now show an example, together with detailed explanation: Consider pricing `p=[0,1,2,1,0]`; and signals `s=[0,1,2,1,0]`, that is: 'we should hold the same amount of stocks as the stock's price'. Way 1: > Started at day 0 with 0 stocks. Beginning of t=1. current price: 1, current holding rule: 1 Flattening to 0 stocks: will sell 0 stock(s) for price 1 each. action total: +0, cumulative total: +0.0 Should hold 1 stock(s): will buy 1 stock(s) for price 1 each. action total: -1, cumulative total: -1.0 Beginning of t=2. current price: 2, current holding rule: 2 Flattening to 0 stocks: will sell 1 stock(s) for price 2 each. action total: +2, cumulative total: +1.0 Should hold 2 stock(s): will buy 2 stock(s) for price 2 each. action total: -4, cumulative total: -3.0 Beginning of t=3. current price: 1, current holding rule: 1 Flattening to 0 stocks: will sell 2 stock(s) for price 1 each. action total: +2, cumulative total: -1.0 Should hold 1 stock(s): will buy 1 stock(s) for price 1 each. action total: -1, cumulative total: -2.0 Beginning of t=4. current price: 0, current holding rule: 0 Flattening to 0 stocks: will sell 1 stock(s) for price 0 each. action total: +0, cumulative total: -2.0 Should hold 0 stock(s): will buy 0 stock(s) for price 0 each. action total: +0, cumulative total: -2.0 So, in total, we lose -2.0 money using way 1. Now, consider way 2 with same settings: > Started at day 0 with 0 stocks. Beginning of t=1. current price: 1, current holding rule: 1 Calculating profits: currently holding 0 stock(s), and price went 0->1. action total: +0, cumulative total: +0.0 Will rebalance to hold 0->1 stocks for price 1 each. action total: -1, cumulative total: -1.0 Beginning of t=2. current price: 2, current holding rule: 2 Calculating profits: currently holding 1 stock(s), and price went 1->2. action total: +1, cumulative total: +0.0 Will rebalance to hold 1->2 stocks for price 2 each. action total: -2, cumulative total: -2.0 Beginning of t=3. current price: 1, current holding rule: 1 Calculating profits: currently holding 2 stock(s), and price went 2->1. action total: -2, cumulative total: -4.0 Will rebalance to hold 2->1 stocks for price 1 each. action total: +1, cumulative total: -3.0 Beginning of t=4. current price: 0, current holding rule: 0 Calculating profits: currently holding 1 stock(s), and price went 1->0. action total: -1, cumulative total: -4.0 Will rebalance to hold 1->0 stocks for price 0 each. action total: +0, cumulative total: -4.0 Here, we lose 4.0 money. Both ways seem OK when I try to find 'bugs' but since I get different results, there certainly must be something I miss. What is it?
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.