I have an algo running but I logged into Interactive Brokers and placed a manual options trade.  I have the initialize section set up to recognize QQQ options and the algo itself purchases them so it should recognize when it is owned in the portfolio.  In case I need to restart the algo I have a section of OnData as follows below.  In case the algo restarts and an option is held in securities.  It can pull that option, change a list number that would suggest it is holding the option, etc.  For some reason it did not do that at all when I manually purchased the option with the algo actively running.  In fact, the option that I purchased is not even in my Holdings section on the Live Deploy.  Any reason why when purchasing securities or options manually (though IB and not on the live deploy tab) it doesn't register it on the live algo even though it is in the portfolio? I thought that the next minute Ondata runs it would pull the option that is in my portfolio.

calloptioninvestedQQQ = [symbol for symbol, holding in self.Portfolio.items() if holding.IsLong and holding.Type == SecurityType.Option and symbol.Underlying.Equals(self.symbolqqq) and symbol.ID.OptionRight == OptionRight.Call]
        
 
#trading logic for QQQ options
#if algo restarts and option invested this will update the lists and option logs
        if calloptioninvestedQQQ:
            if self.qqqcalloptionlist[0] == 0: 
                self.qqqcalloptionlist[0] = 5
                self.callcontractqqq = calloptioninvestedQQQ[0]

Author