Rebalance pie with restricted sales

Currently when you rebalance a pie it sells without considering whether each sale results in a loss.

It would be great to have an option that would only sell positive shares and redistribute to the underallocated. It would not be a full rebalance as there might not be enough sellable to make everything back up to the allocated pie % but could at least reduce the drift.

This would allow “locking in” any gains without accidentally locking in some losses.

Obviously if all shares in the pie were in the green then it would just be the same as a normal rebalance.

Maybe the most flexible option would just be to allow you to unselect the stocks to sell on the rebalance confirmation page?