Sell one of the ten stocks when a stronger stock has buy signal

I am doing portfolio backtesting and hoping to sell one of the ten stocks when the stock universe has a new buy signal on a stronger stock. I searched for function like PositionScore but I found that it seems to be used in rotational trading mode only (correct me if I was wrong) but as my codes are built in for loop format, therefore I am not sure how I might be able to do it.

Would someone be able to give me some hints? Thank you.

PositionScore is used always. But in regular backtest modes it us used to rank ENTRY signals. What you want is to CLOSE position if it drops below top N-ranked list. That is exactly what ROTATIONAL mode is about, so you need to run use ROTATIONAL mode if you want to drop positions that go off rank. And it does not matter that you use loop.

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.