Fix Security.IsMarketOpen for cases outside regular MH and last bar (#7343)
* Fix Security.IsMarketOpen for cases outside regular MH and last bar * Minor changes * Move bar check of IsMarketOpen into FillModel * Minor changes * Minor changes * Minor changes
This commit is contained in:
@@ -51,7 +51,7 @@ class BasicTemplateOptionsDailyAlgorithm(QCAlgorithm):
|
||||
contracts = sorted(chain, key = lambda x: x.Expiry)
|
||||
|
||||
# if found, trade it
|
||||
if len(contracts) == 0 or not self.IsMarketOpen(contracts[0].Symbol): return
|
||||
if len(contracts) == 0: return
|
||||
symbol = contracts[0].Symbol
|
||||
self.MarketOrder(symbol, 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user