I'm wondering if there is a facility to manage multiple portfolios in an algorithm. If there is I haven't seen it. The following is an example of what I am asking about. Every month, you rank your universe by some factor and pick n stocks to buy. You buy them and then hold this particular n stocks for 1 year. The next month, you do it all over again, so you end up with 12 overlapping portfolios. To make things complicated, you can buy the same stock in consecutive months. If the stocks were forced to be exclusive, I think you could manage this by tracking the separate portfolios in a dummy dictionary of sub-portfolios. But when you allow for buying the same stock in separate portfolios, selling becomes a problem because I believe Q treats everything as being in one portfolio, whereas I would specifically want to sell those shares of a stock (that is potentially in other sub-portfolios) in the currently maturing portfolio.