Hey guys, I've reviewed the options documentation and there are many types of data that can be accessible from an options contract.  I was just looking for suggestions on how to best pull some of this information from a currently invested option.

In the on data section I have the following:

option_invested = [x.Key for x in self.Portfolio if x.Value.Invested and x.Value.Type==SecurityType.Option]

 

So is there a way for me to pull other data from the information stored in “option_invested”?  like the Expiry date and the underlying symbol?

 

I tried the following but it doesn't work:

self.optionsinvested = option_invested
       
       qqqexpiry = self.optionsinvested.ID.expiry
       optionsunderlyingsymbol = self.optionsinvested.ID.UnderlyingSymbol

 

I also tried to just fill option_invested with only QQQ options with the following but it doesn't work:

option_investedqqq = [x.Key for x in self.Portfolio if x.Value.Invested and x.Value.Type==SecurityType.Option and x.UnderlyingSymbol=="QQQ"]

Author