Hello folks,

I'm trying to extract option chain using universal filter (not considering the optimization now). When I use `universe` function version vs `SetFunction`, strike prices are completely different. For instance:

def UniverseFunc(self, universe):
        return universe.IncludeWeeklys().Strikes(-15, 15).Expiration(timedelta(20), timedelta(30))

If my equity is `TSLA` then I'll only get strike price five difference. Sample:

[170.0, 175.0, 180.0, 185.0, 190.0, 195.0, 200.0, 205.0, 210.0]

Again, this same code could produce:

[110.0, 111.0, 111.67, 112.0, 113.0, 113.33, 114.0, 115.0, 116.0, 116.67, 117.0, 118.0, 118.33, 119.0, 120.0, 121.0, 121.67, 122.0, 123.0, 123.33, 124.0, 125.0, 126.0, 126.67, 127.0, 128.33, 130.0]

strikes as well at the end time of the backtest. On the other hand if I use 

option.SetFilter(-15, 15, timedelta(20), timedelta(30))

Then first couple of days of my backtesting, there won't be any option chain available. but looks like I always get all interval strike:

[115.0, 116.67, 118.33, 120.0, 121.67, 123.33, 125.0, 126.67, 128.33, 130.0, 131.67, 133.33, 135.0]

So, questions:

  • Why `SetFilter` using `Universe` vs `SetFilter` function shows completely different data?
  • How can I make sure I'll always get consistent data with all interval between min and max?

 

Looking forward for some help here. Btw, I'm a brand new person and I really appreciate your time and response.

Thanks   

Author