Number of positions > specifications ?

Setup:

Ideal Size = 3.33
Approx # Positions = 30
No Margin

Holdings:

of stocks in portfolio = 31

Is this normal behavior or is this a bug? Thanks!

Normal. Try 3.333.

Reduce the max weight deviation in the position sizing and you’ll get less variant holding quantities. With 30% max weight deviation (default) I often get # of positions one off.

There is something wrong IMO, in another sim I have this setup:

Ideal Size = 4
Approx # Positions = 25
10% max deviation
No Margin

Holdings:

of stocks in portfolio = 28

3 more??

It’s possible if a few positions get really huge over a relatively long holding period and the rest lose a lot of their value that when you sell the huge positions and buy new ones you could end up with three extra holdings. Is that what happened?

I tried doing a simulation with ideal size = 4, approx # positions = 25, 10% max deviation, no margin, with a very good ranking system, weekly rebalancing, and only one sell rule: weight > 10. After 18 years, I ended up with 45 positions.

That’ll happen as your cash balance grows due to dividends. You’ll hit the point where you have enough cash for a new position, and because you haven’t sold anything, the sim just takes a new position. With more frequent selling, the sim has a chance to accumulate larger positions and keep the total number of positions down.