Hi, is there some method that can tell me when I own some stock or only its options?

I tried to use Portfolio.IsInvested() but it returns TRUE for both, stocks and options, meanwhile, I don't want it give info about options, I want to check if I own the stock only.


I sell naked put option, then I'm assigned to execute this option, so I have to buy underlying shares. I don't want to own shares, so I need to check and if I own any shares (not options) I want to sell shares. Basically, I need some method that works with shares only and doesn't affect options.