Hello everyone, can anyone help me with one line of the code here?  Below is my options filter to obtain DTE0 covered call option on QQQ.  I've run this for puts and it works but for some reason on the call side, (AND only when running live) it is pulling expired options from 1 month ago, which aren't tradeable.  The backtesting works fine.  I've tried to change the following line of code but I keep getting errors.  Probably a simple fix and my lack of coding skills is making it more difficult.  

Thanks in advance!

Here is the section I need to change:

qqqotm_calls = [i for i in callcontractsqqq if i.ID.OptionRight == OptionRight.Call and
                                            i.ID.StrikePrice > self.qqqCoveredCallOTM * self.underlyingPriceqqq and
                                            (i.ID.Date - data.Time).days < self.qqqCoveredCallDTE]

Its this part that I'm messing with.  Mine line self.qqqCoveredCallDTE equals zero. 

(i.ID.Date - data.Time).days < self.qqqCoveredCallDTE]

I tried the following which just gives an error:

i.ID.Date == data.Time.Date

Here is the whole options filter:

def Buyqqqcoveredcall(self, data):
        if self.coveredcallcontractqqq == str():
            self.Log("Obtaining QQQ covered call contract")
            self.coveredcallcontractqqq = self.OptionsFilterqqqcoveredcall(data)
            self.Log("Covered QQQ Call contract: {0}".format(self.coveredcallcontractqqq))
            return

        if not self.Portfolio[self.coveredcallcontractqqq].Invested and data.ContainsKey(self.coveredcallcontractqqq):
            Contractstosell = self.qqqnumberofcontracts[0]
            self.Log("Covered QQQ Call contract: {0}, Number of contracts to sell: {1}".format(self.coveredcallcontractqqq, Contractstosell))
            self.MarketOrder(self.coveredcallcontractqqq, -Contractstosell)
            self.qqqcoveredcalllist[0] = 1
            self.Log("Sold QQQ covered calls: {0}".format(Contractstosell))  

   
            
 def OptionsFilterqqqcoveredcall(self, data):
        callcontractsqqq = self.OptionChainProvider.GetOptionContractList(self.symbolqqq, data.Time)
        self.underlyingPriceqqq = self.Securities[self.symbolqqq].Price
        qqqotm_calls = [i for i in callcontractsqqq if i.ID.OptionRight == OptionRight.Call and
                                            i.ID.StrikePrice > self.qqqCoveredCallOTM * self.underlyingPriceqqq and
                                            (i.ID.Date - data.Time).days < self.qqqCoveredCallDTE]
                                            
        if len(qqqotm_calls) > 0:
            callqqqcontract = sorted(sorted(qqqotm_calls, key = lambda x: abs(x.ID.StrikePrice - self.underlyingPriceqqq)))[0]
            if callqqqcontract not in self.coveredcallcontractsAddedqqq:
                self.coveredcallcontractsAddedqqq.add(callqqqcontract)
                self.AddOptionContract(callqqqcontract, Resolution.Minute)
            contractarray = sorted(sorted(qqqotm_calls, key = lambda x: abs(x.ID.StrikePrice - self.underlyingPriceqqq)))
            strikes = [x.ID.StrikePrice for x in contractarray]
            self.qqqdtezerostrike[0] = strikes[0]
            self.Log("QQQ Opt filter Call contract {0}".format(callqqqcontract))
            self.Log("contract strike price: {0}".format(self.qqqdtezerostrike[0]))
            return callqqqcontract
        else:
            return str()