18 using System.Collections.Generic;
24 using System.Collections;
37 private bool _needNewCurrent;
38 private DateTime _lastEmitTime;
55 IEnumerator<BaseData> underlying,
59 _subscriptionRequest = subscriptionRequest;
61 _universeProvider = universeProvider;
62 _timeProvider = timeProvider;
64 _needNewCurrent =
true;
75 object IEnumerator.Current =>
Current;
101 if (!_needNewCurrent)
104 _needNewCurrent = _timeProvider.GetUtcNow().ConvertFromUtc(_subscriptionRequest.Configuration.ExchangeTimeZone).Date != _lastEmitTime.Date;
109 if (!_universeProvider.CanPerformSelection())
115 var localTime = _timeProvider.GetUtcNow()
116 .ConvertFromUtc(_subscriptionRequest.Configuration.ExchangeTimeZone)
117 .RoundDown(_subscriptionRequest.Configuration.Increment);
120 var symbols = _universeProvider.LookupSymbols(_subscriptionRequest.Security.Symbol,
false);
131 Log.
Trace($
"DataQueueOptionChainUniverseDataCollectionEnumerator({_currentData.Symbol}): Emitting data point: {_currentData.EndTime}. " +
132 $
"Count: {_currentData.Data.Count}. Underlying: {_currentData.Underlying} Underlying.EndTime: {_currentData.Underlying.EndTime}");
134 _lastEmitTime = localTime;
137 _needNewCurrent =
false;
161 _needNewCurrent =
true;