Hi Everyone,

  I have been working of getting comfortable with the options backtesting.  I am currently trying to keep my optinos universe updated correctly.  The problem i am experiencing is that the Options universe keeps expanding as time goes on, even though the desired universe should stay fixed ( 5 underlyings ).

  I am using the CoarseSelectionFunction to select the top 5 equities by dollar volume.  The idea is that I want to also have the option chains corresponding to these underylings.  

  I use the AddOption function inside the CoarseSelectionFunction to accomplish this (its probably not the right way to do it).  

def CoarseSelectionFunction(self, coarse): '''Take the top 5 by dollar volume using coarse''' # sort descending by daily dollar volume sortedByDollarVolume = sorted(coarse, \ key=lambda x: x.DollarVolume, reverse=True) # add Options for x in sortedByDollarVolume[:5]: option = self.AddOption(x.Symbol.Value, Resolution.Minute) option.SetFilter(-2, +2, timedelta(0), timedelta(180)) self.AddEquity(x.Symbol.Value, Resolution.Minute) # we need to return only the symbol objects return [ x.Symbol for x in sortedByDollarVolume[:5] ]

  As you can see in the attached backtest, in the Log, each week the number of items in the universe keeps going up. ( the number of symbols in the OPtionChains object increases ).  This is logical as each time through the universe filter new options are added but not removed.

  How am I supposed to keep the option universe up-to-date correctly?

Thanks

Author