Mergers will count in the rank pushing the rankPos down (perhaps below 20) for a stock. But when the port looks for stocks to buy it will bypass the stock set to merge: buying a stock ranked, say, 21.
You have a conflict in your buy and sell rules where they don’t mirror each other or there is an inconsistency in how a stock is sold and then instantly bought back for some reason because the buy rules did not take into consideration the sell rules. Your buy rules should always be tighter than your sell rules. Or at least the negation of it. That always fixes the problem for me. I think that is why it is called buy/sell difference.
But David, he says he HAS no buy rules, and the only sell rule is rankpos > 20. I think Jim’s explanation is the correct one. If “Allow Mergers” is set to 0, then highly ranked stocks that are on the verge of being acquired will not be bought, and the system will buy the 21st ranked stock.
Yuval, his not having any buy rules could be causing the problem. As I said: Your buy rules should always be tighter than your sell rules. Or at least the negation of it.