Hi all,

I am sure this has already been solved on the forum, however I couldn't really find what I was looking for in other threads I read. 

I am having an Algo that uses a dynamic universe filters stocks based on fundamental ratios.

Currently I allocate 100% of the free portfoliovalue to the securities received by the algo by 

self.portfolioTargets = [PortfolioTarget(symbol, 1/(len(self.activeStocks))
                        for symbol in self.activeStocks]

and then 

self.SetHoldings(self.portfolioTargets)

The issue clearly is that I am always investing 100% of the cash and in order to open a new position a previous one has to be liquidated as well as that it is obviously not optimal to have 100% allocated to for example 1 positions. 

Does anyone have model where if for example only 1 or 2 positions are opened only a smal percentage of the cash is allocated so that if in the next day one or more positions are added enough cash is onhand to open these?

Still learning so I appreciate all the help, thank you!

Author