Hello QC community,

i took the code from the long straddles but I have to use straddles that are delta neutral… Does somebody know how to do this? Either you try to match the different contents in the chain to give delta zero or you just check the delta and try to add from the other one as much as it needs to give zero. But because you cant buy 1.112 options I really dont know how to do this.

def TradeOptions(self,chains):
        if chains is None: return
        expiry = sorted(chains,key = lambda x: x.Expiry, reverse=False)[0].Expiry
        # filter the call and put contract
        call = [i for i in chains if i.Expiry == expiry and i.Right == OptionRight.Call]
        put = [i for i in chains if i.Expiry == expiry and i.Right == OptionRight.Put]
        
        # sorted the contracts according to their strike prices 
        call_contracts = sorted(call,key = lambda x: x.Strike)    
        if len(call_contracts) == 0: return
        self.call = call_contracts[0]
        for i in put:
            if i.Strike == self.call.Strike:
                self.put = i
        self.Buy(self.call.Symbol, 1)
        self.Buy(self.put.Symbol ,1)

Thanks in advance!