I have been trying to completely liquidate a portfolio however even after explicit Liquidate() and SetHoldings to 0 - I can't seem to have the Portfolio liquidated.

self.Liquidate()
        for ticker in self.tickers:
            if self.Portfolio[ticker].Invested:
                self.SetHoldings(ticker,0)
                self.Debug(str(ticker)+" "+str(self.Portfolio[ticker].Quantity))

The Debug report still shows the Holdings...

This is done OnEndofAlgorithm.

 

TY