diff --git a/Algorithm.CSharp/FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.cs b/Algorithm.CSharp/FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.cs index a374b8043c2c..c85e0589fe76 100644 --- a/Algorithm.CSharp/FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.cs +++ b/Algorithm.CSharp/FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.cs @@ -85,7 +85,7 @@ public override void OnOrderEvent(OrderEvent orderEvent) if (!time.IsOpen(orderEvent.UtcTime, _SP500EMini.IsExtendedMarketHours)) { - throw new Exception($"The Exchange hours was closed, checko 'extendedMarketHours' flag in {nameof(Initialize)} when added new security(ies)."); + throw new Exception($"The Exchange hours was closed, verify 'extendedMarketHours' flag in {nameof(Initialize)} when added new security(ies)."); } } } diff --git a/Algorithm.Python/FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.py b/Algorithm.Python/FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.py index 70db51277169..3e92e2b4716b 100644 --- a/Algorithm.Python/FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.py +++ b/Algorithm.Python/FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.py @@ -47,9 +47,6 @@ def OnData(self, slice): self.stopPrice = self.stopMarketTicket.Get(OrderField.StopPrice) self.bar = self.Securities[self.stopMarketTicket.Symbol].Cache.GetData() - if self.stopPrice > self.bar.Low: - self.Log(f"{self.stopPrice} -> {self.bar.Low}") - # An order fill update the resulting information is passed to this method. def OnOrderEvent(self, orderEvent): if orderEvent is None: @@ -64,7 +61,7 @@ def OnOrderEvent(self, orderEvent): # Validate, Exchange is opened explicitly if (not exchangeHours.IsOpen(orderEvent.UtcTime, self.SP500EMini.IsExtendedMarketHours)): - raise Exception("The Exchange hours was closed, checko 'extendedMarketHours' flag in Initialize() when added new security(ies)") + raise Exception("The Exchange hours was closed, verify 'extendedMarketHours' flag in Initialize() when added new security(ies)") def OnEndOfAlgorithm(self): self.stopMarketOrders = self.Transactions.GetOrders(lambda o: o.Type is OrderType.StopMarket) diff --git a/Common/Orders/Fills/FutureFillModel.cs b/Common/Orders/Fills/FutureFillModel.cs index 3638e88b1cc4..f49d7e13a0fc 100644 --- a/Common/Orders/Fills/FutureFillModel.cs +++ b/Common/Orders/Fills/FutureFillModel.cs @@ -107,6 +107,8 @@ public override OrderEvent StopMarketFill(Security asset, StopMarketOrder order) if (order.Status == OrderStatus.Canceled) return fill; // Fill only if open or extended + // even though data from internal configurations are not sent to the algorithm.OnData they still drive security cache and data + // this is specially relevant for the continuous contract underlying mapped contracts which are internal configurations if (!IsExchangeOpen(asset, Parameters.ConfigProvider.GetSubscriptionDataConfigs(asset.Symbol, includeInternalConfigs: true).IsExtendedMarketHours())) { return fill;