Is there a way in a sell rule to flag if a position I don't own is ranked in the top 10?

Hi, In a simulation, is there a relatively straightforward way to flag if a stock ranked in the top 10 positions of a ranking system is not held in the current portfolio?

For example,

  • let’s say my default sell rule is to sell anything with rankposition > 60.
  • So in this scenario, when the sim reevaluates let’s say all of my rank positions held in the portfolio are still less than 60. So no sell rule would normally fire. Nothing is sold. Nothing is bought.
  • Is there a way to create an aditional “OR” sell condition that says “If there’s a stock ranked in the top 10 that is not in the portfolio, then sell and rebalance?”
  • To reduce transactions, the additional “OR” sell condition rule might be restricted to take the form only selling anything over rankpos 40 to buy higher ranking positions while leaving everything else alone. The key step is identifying if there’s something in the top 10 that’s not presently in the existing portfolio.

My purpose here is that I’m wanting to test some sims on a more frequent rebalancing/reevaluation, but I want to try to keep turnover low at the same time while making sure I pick up opportunities when they pop into the top 5 or 10 spots.

thanks for any ideas.

Shane, this is not a STRAIGHTFORWARD way to do it, but here’s how I do it. Use the formula weight option. Set your number of positions to 100. Allow plenty of deviation from the maximum. As your buy rule, use rankpos <= 10. And as your sell rule, use rankpos > 60.

The end result is a simulation that will always buy a new stock if its rank position is 10 or less and always sell it if its rank position is greater than 60. Unfortunately, it will often use margin to accomplish this goal, so your results are going to be inflated; in addition, the number of stocks you hold will vary a great deal.

An even more sophisticated way of doing this is to get rid of the sell rule and use formula weight rebalancing to diminish your positions as they get lower in rank. For example, your formula might be 60 - rankpos. Or 4.09 - ln(rankpos). You get the idea . . .

To reduce rebalancing, set your maximum portfolio drift pretty high and the maximum position drift and minimum rebalance transaction relatively high too. Try a few runs, look at the transactions, and see what works best for you.

  • Yuval

Sell rules only operate on things held, for the most part. The exception, I believe, is for cross sectional functions. So my guess is no, it’s not possible given the current resources.

let’s say I have a 20 position portfolio, with allow buy back set to YES.
Now 2 of my positions are sold.
How will the sold money be allocated?

  • equal weight to 2 new positions?
  • equal weight to 2 positions of which one or more may be existing but rank in the top 20
  • some other way.

Looking for clarity

Thanks all for the replies. Much appreciated. :wink:

crastogi, I have sims that do different things.

This probably won’t help much (sorry :wink: ), but looking through several of my sims, it looks like if two stocks are sold, it pools the proceeds and buys 2 stocks at equal wt to replace, up to the ideal position size. It looks like if there is any money left over additional smaller positions might be bought subject to minimum transaction amounts. I’m not sure of order of precedence, but maybe added to the most underweight position?) Sometimes if positions have grown too large, additional small sells are made to keep the position size within the allowable range, and these proceeds are added to the amount that allocated to new purchases. All of this seems subject to minimum transaction amounts, so sometimes cash will accumulate until there’s enough for extra marginal purchase.

Yuval, thanks for the idea on this. I hadn’t considered using settings like high position drift and high minimum rebalance transaction settings as a defacto limiting or over-riding element of the sell rule itself. My real life position sizes are small, so anything except large % position size changes (a third, half or whole) often doesn’t make logistical sense without getting into tiny odd lots.