Most likely when the optimal position (generated from forecasts) goes to being a different sign to the current position. So if we're long, but then the forecast goes short, we'll close our position. We could also close earlier if the optimal position gets small enough, and the trading costs...