liveBook · Manning

Threshold-based rebalancing

As explained in Build a Robo-Advisor with Python (From Scratch)

Threshold-based rebalancing is a rebalancing method that trades when an asset's portfolio weight deviates beyond a specified tolerance from its target.

Threshold-based rebalancing checks a portfolio periodically but trades only after its deviation from target becomes large enough. Compared with fixed-interval rebalancing, it reduces unnecessary trades while limiting portfolio drift, at the cost of choosing thresholds and inspecting holdings more often. section 13.2.2

Choose a measurement that determines when the portfolio needs attention:

  • Weight deviation: trade when any asset’s current weight differs from its target by a predetermined amount. section 13.2.2
  • Tracking error: trade when the portfolio’s tracking error against the target becomes large. section 13.2.2
  • Volatility-based deviation: trade when an asset’s deviation multiplied by its volatility exceeds a threshold. section 13.2.2

A 0.5% weight trigger

A threshold function can align current and target asset indexes, calculate absolute weight differences, and return true when the largest difference exceeds 0.005. The resulting policy can inspect the portfolio daily or weekly and rebalance only when the condition is met. section 13.2.2

A practical implementation separates the rebalance decision from trade generation. ThresholdBasedRebalancer supplies the trigger, while SimpleRebalancer can trade the invested portfolio fully back to target weights and select tax-optimized lots. Full restoration is optional: selling only enough to return within the tolerance can avoid realizing costly short-term gains. section 13.4.1 section 13.2.3

How Build a Robo-Advisor with Python (From Scratch) covers it

How deep it goes
Explains trigger choices, trade-offs, Python classes, complete trades, tax-lot selection, and partial correction within tolerance.
Examples
Demonstrates a 0.005 maximum-weight-difference function, complete dollar trades, and tax-lot sales ordered by effective tax rate.
What it assumes
Assumes target weights, current holdings, investment value, and basic portfolio trading concepts; defines the rebalancer interface and calculations.
What you can do after
Build it from scratch as a Python rebalancer that evaluates thresholds, generates target trades, and incorporates tax-lot choices.
How it connects
Connects portfolio drift, target allocation, interval-based rebalancing, tracking error, volatility, tax-aware rebalancing, and backtesting.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Robo-Advisor with Python (From Scratch). The section links point to the parts of the book it draws on.