Rebalancing your portfolio requires buying and selling shares. In most countries that will attract capital gains taxes, often affected by when you bought those shares.<p>If you care about tax efficiency -- which can severely deplete your on-paper returns -- then it&#x27;s not really ~5 lines of code at all.<p>If you&#x27;re looking for dumb-and-good-enough, delegating the fiddly rebalancing problem to someone with economies of scale isn&#x27;t really so bad.