Conflicting buy and sell rules

In a simulation if your buy rules pick up a stock that would also be considered an immediate sell, what happens? ie. buy high market cap, sell high p/e. You should probably write your rules to prevent this from happening, but how does the system handle it if you choose Allow Immediate Buyback = Yes or when Allow Immediate Buyback = No.

So this is a common approach. You simply add the word ‘true’ or ‘1’ into a sell rule.

This means it will always sell no matter what.

If you allow it to immediately buyback…all it does is act like a screener/backtester. It will always hold the top ranked stocks that pass your rules.

If you don’t allow it to immediately buyback, then it will look for the next highest ranked stocks that pass your rules. To illustrate…

You want 10 stocks that are highest ranked. You have a sell rule of ‘true’ and you do not allow immediate buyback. Therefore, after your first rebalance period stocks ranked 1-10 are sold and cannot be repurchased. Instead you buy stocks ranked 11 - 20. Then next rebalance these ones are sold and providing nothing has changed, you sell those and repurchase stocks 1-10 again.

Okay, got it. So Allow Immediate Buyback = Yes effectively ignores the sell rule if a to-be-sold stock was also the top qualifying buy. Thanks. I was thinking about turnover and it got me thinking about that (so no extra turnover). I’ll continue to use buy rules to screen out anything that would otherwise be considered a sell anyway.