I have the following which works great if I have an option with underlying of QQQ:

optioninvestedQQQ = [symbol for symbol, holding in self.Portfolio.items() if holding.Invested and holding.Type == SecurityType.Option and symbol.Underlying.Equals(self.symbolqqq)]

       

How can I add to this code to fill with only a put or a call?

 

Thanks in advance