Enable daily precise end time by default (#8254)
API Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
* Default daily precise end times - Enable by default daily precise end times. Updating stats - Minor fix for algorithm manager consolidator updates, adding new regression test asserting behavior and updating others - Minor fix for SubscriptionData creator avoid round down on warmup if not appropiate - Adjust consolidators to emit on daily strict end times if requested daily resolution and setting enabled - Updating regression algorithms * Skip daily data on extended market hours * Some cleanup and self review * Revert unrequired change
This commit is contained in:
@@ -49,10 +49,7 @@ class BasicTemplateFuturesDailyAlgorithm(QCAlgorithm):
|
||||
contract = sorted(contracts, key = lambda x: x.expiry)[0]
|
||||
|
||||
# if found, trade it.
|
||||
# Also check if exchange is open for regular or extended hours. Since daily data comes at 8PM, this allows us prevent the
|
||||
# algorithm from trading on friday when there is not after-market.
|
||||
if self.securities[contract.symbol].exchange.hours.is_open(self.time, True):
|
||||
self.market_order(contract.symbol, 1)
|
||||
self.market_order(contract.symbol, 1)
|
||||
# Same as above, check for cases like trading on a friday night.
|
||||
elif all(x.exchange.hours.is_open(self.time, True) for x in self.securities.values() if x.invested):
|
||||
self.liquidate()
|
||||
|
||||
Reference in New Issue
Block a user