liveBook · Manning

Do-not-trade-past-target constraint

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

A do-not-trade-past-target constraint prevents trading an asset from one side of its target position to the other side.

A do-not-trade-past-target constraint prevents rebalancing from crossing an asset’s target position. It keeps overweight assets at or above target and underweight assets at or below target. section 13.3.2

Implement the constraint by:

  • Constraining each optimized position according to whether its current position is above or below target. section 13.3.2

Underweight AGG

If AGG is currently worth $3,800 and its target position is $4,000, the optimizer may buy AGG up to $4,000 but cannot make it overweight. section 13.3.2

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

How deep it goes
Explains directional bounds and shows a per-asset Python constraint implementation, without detailing the complete optimizer.
Examples
Uses an AGG position worth $3,800 against a $4,000 target to demonstrate the maximum allowable optimized position.
What it assumes
Requires current holdings, target weights, investment value, and optimizer position variables.
What you can do after
Implement a per-asset optimizer constraint using current holdings, target weights, and position variables.
How it connects
Connects target weights, portfolio rebalancing, optimized positions, and optimization constraints.

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.