Default option filter now includes weeklies to prevent empty chains (#9162)
* Return weekly contracts if no standard contracts exist * Fix unit and regression tests * Centralize default expiration type flags * Add ExcludeWeeklys() method * Mark IncludeWeeklys() as obsolete since weeklies are now default
This commit is contained in:
@@ -27,7 +27,7 @@ class OptionStrategyFactoryMethodsBaseAlgorithm(QCAlgorithm):
|
||||
option = self.add_option("GOOG")
|
||||
self._option_symbol = option.symbol
|
||||
|
||||
option.set_filter(-2, +2, 0, 180)
|
||||
option.set_filter(lambda u: u.standards_only().strikes(-2, +2).expiration(0, 180))
|
||||
|
||||
self.set_benchmark("GOOG")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user