Cash divestment and trade system

Let's say that I created a model where I keep stocks in gain for at least 6 months (for tax reasons) and can sell stocks in loss whenever.
If the strategy grows too (fingers crossed), and using the trade system linking Portfolio123 and Interactive Brokers, I will want to divest money. However a classic rebalance would not do it as it would trigger a sale of all stocks including the ones in gain and held less than 6 months. Hence, the solution could be that whenever there is a sell, I do not reinvest the full amount. How would be the way to deal with that with the trade system? Would it work with the use of "drive" instead of "follow"?