I want to write a positional algo on Nifty 50 list. I would like to have max 10 positions open at any point in time.
e.g. on day-1, I enter 3 positions which satisfy a criteria
on day-3, 12 stocks satisfy the criteria, but I want to enter into only 7 of these so that max 10 positions are open at a time.
also when I exit few stocks based on some criteria, I would like to enter again for the remaining open positions upto 10 when entry condition occurs.
How to achieve that?