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:
@@ -34,7 +34,7 @@ class BasicTemplateOptionsAlgorithm(QCAlgorithm):
|
||||
self.option_symbol = option.symbol
|
||||
|
||||
# set our strike/expiry filter for this option chain
|
||||
option.set_filter(lambda u: (u.strikes(-2, +2)
|
||||
option.set_filter(lambda u: (u.standards_only().strikes(-2, +2)
|
||||
# Expiration method accepts TimeSpan objects or integer for days.
|
||||
# The following statements yield the same filtering criteria
|
||||
.expiration(0, 180)))
|
||||
|
||||
Reference in New Issue
Block a user