Sub topic 2
Threshold rebalancing: rebalance when drift is large
This chapter assumes you can compute portfolio weights as percentages, that you know what drift is, and that you can read basic Python. Threshold rebalancing ignores the calendar. You check the portfolio, and you trade only when an asset class has moved far enough from its target to breach a tolerance band.
Threshold rebalancing: rebalance when drift is large
A threshold rule sets a tolerance around each target weight. If an asset class moves outside that tolerance, you rebalance. If it stays inside, you do nothing. This keeps trading low when the portfolio is close to target and responds quickly when it is not.
Absolute and relative bands
An absolute band is a fixed number of percentage points, such as 5 points. A relative band is a fraction of the target, such as 25 percent of the target. For a 60% stock target, a 25% relative band allows 15 points of drift, while a 5-point absolute band allows only 5 points. Choose the band that fits how much drift you can tolerate.
def breaches_band(weights, targets, abs_band=None, rel_band=None):
out = []
for a, target in targets.items():
drift = abs(weights[a] - target)
if abs_band is not None and drift > abs_band:
out.append(a)
elif rel_band is not None and drift > rel_band * target:
out.append(a)
return outHybrid rules: check on a schedule, trade only if a band is breached
A hybrid rule combines the two. You check the portfolio on a calendar schedule, for example every 3 months, and you trade only if a band is breached on that date. This avoids frequent trading while still reacting to large moves.
Turning weights into buy and sell amounts
To rebalance, compute the dollar value each asset class should hold, then subtract its current value. Positive results are buys and negative results are sells. The trades net to zero when you rebalance within the portfolio.
from datetime import date
def calendar_due(last, today, interval_months):
elapsed = (today.year - last.year) * 12 + (today.month - last.month)
return elapsed >= interval_months
def hybrid_should_trade(last, today, interval_months, weights, targets, abs_band):
if not calendar_due(last, today, interval_months):
return False
return bool(breaches_band(weights, targets, abs_band=abs_band))
def rebalance_trades(values, targets):
total = sum(values.values())
return {a: targets[a] * total - values[a] for a in targets}
targets = {"stocks": 0.60, "bonds": 0.40}
values = {"stocks": 72000.0, "bonds": 38000.0}
total = sum(values.values())
weights = {a: values[a] / total for a in values}
print(hybrid_should_trade(date(2026, 1, 1), date(2026, 4, 1), 3,
weights, targets, abs_band=0.05))
print(rebalance_trades(values, targets))The output is True, then {'stocks': -6000.0, 'bonds': 6000.0}. Stocks are 65.5% of the portfolio, a 5.5-point drift that breaches the 5-point band. The rule sells 6,000 of stocks and buys 6,000 of bonds.
> Rebalancing to the band edge instead of the target trades less, but it leaves the portfolio partly off target.
Exercise
A portfolio has stocks at 70% against a 60% target, and bonds at 30% against a 40% target. Using a 5-point absolute band, does a threshold trigger occur, and which trade restores the target?
Show answer
Yes. Stocks drift 10 points, which exceeds the 5-point band. Selling stocks and buying bonds, each by 10% of the total value, restores the 60/40 target.