diff --git a/Engine/HistoricalData/BrokerageHistoryProvider.cs b/Engine/HistoricalData/BrokerageHistoryProvider.cs index 8cf9e1e74476..f0cefeaefe78 100644 --- a/Engine/HistoricalData/BrokerageHistoryProvider.cs +++ b/Engine/HistoricalData/BrokerageHistoryProvider.cs @@ -71,6 +71,11 @@ public override IEnumerable GetHistory(IEnumerable reques foreach (var request in requests) { var history = _brokerage.GetHistory(request); + if (history == null) + { + // doesn't support this history request, that's okay + continue; + } var subscription = CreateSubscription(request, history); _dataPermissionManager.AssertConfiguration(subscription.Configuration, request.StartTimeLocal, request.EndTimeLocal); @@ -78,6 +83,10 @@ public override IEnumerable GetHistory(IEnumerable reques subscriptions.Add(subscription); } + if (subscriptions.Count == 0) + { + return null; + } return CreateSliceEnumerableFromSubscriptions(subscriptions, sliceTimeZone); } } diff --git a/Engine/HistoricalData/HistoryProviderManager.cs b/Engine/HistoricalData/HistoryProviderManager.cs index 62fbde461560..c96ebc0f1b2f 100644 --- a/Engine/HistoricalData/HistoryProviderManager.cs +++ b/Engine/HistoricalData/HistoryProviderManager.cs @@ -88,6 +88,11 @@ public override void Initialize(HistoryProviderInitializeParameters parameters) dataQueueHandler = Composer.Instance.GetExportedValueByTypeName(brokerageName); // initialize it dataQueueHandler.SetJob((Packets.LiveNodePacket)parameters.Job); + Log.Trace($"HistoryProviderManager.Initialize(): Created and wrapped '{brokerageName}' as '{typeof(BrokerageHistoryProvider).Name}'"); + } + else + { + Log.Trace($"HistoryProviderManager.Initialize(): Wrapping '{brokerageName}' instance as '{typeof(BrokerageHistoryProvider).Name}'"); } // wrap it @@ -130,6 +135,11 @@ public override IEnumerable GetHistory(IEnumerable reques try { var history = historyProvider.GetHistory(historyRequets, sliceTimeZone); + if (history == null) + { + // doesn't support this history request, that's okay + continue; + } historyEnumerators.Add(history.GetEnumerator()); } catch (Exception e)