Hi,

sorry I'm sure you are cretainly respond to this answer 1 million times, but I didn't find my answser and from documentation it seems I do right.

So I wrote a simple algo and when I launch BT, it' work but I have any time yhe same result, I changed the data frame minute to daily, buy to sell, date range,... but any time the same result!!

Could you telle me please, where I do wrongly?

Thanks in advance.
Ps: sorry for my english.

my code is:

def Initialize(self):
self.SetStartDate(2015, 4, 1)
self.SetEndDate(2017, 5, 30)
self.SetCash(100000)
equity = self.AddEquity("GOOG", Resolution.Daily)
option = self.AddOption("GOOG", Resolution.Daily)
self.symbol = option.Symbol
# set our strike/expiry filter for this option chain
option.SetFilter(-15, 15, timedelta(35), timedelta(50))
# use the underlying equity GOOG as the benchmark
self.SetBenchmark(equity.Symbol)

for i in optionchain:
if i.Key != self.symbol: continue
chain = i.Value
# sorted the option chain by expiration date and choose the furthest date
expiry = sorted(chain,key = lambda x: x.Expiry, reverse=True)[0].Expiry
# filter the call options from the contracts expires on that date
call = [i for i in chain if i.Expiry == expiry and i.Right == 0]
call_contracts = sorted(call,key = lambda x: x.Strike)
if len(call_contracts) == 0: continue
# choose the deep OTM call option
self.call = call_contracts[-1]

put_contracts = sorted([i for i in chain if i.Expiry == expiry and i.Right == 1], key = lambda x: x.Strike)
# choose the deep OTM put option
self.put = put_contracts[0]

self.Sell(self.call.Symbol ,1)
self.Sell(self.put.Symbol ,1)