18 using System.Collections;
19 using System.Collections.Generic;
31 private bool _endOfStream;
32 private bool _needsMoveNext;
33 private bool _liveMode;
34 private readonly
Symbol _symbol;
35 private readonly IEnumerator<BaseData> _enumerator;
48 _enumerator = enumerator;
50 _needsMoveNext =
true;
73 if (!_enumerator.MoveNext())
76 if (!IsValid(collection))
85 if (_enumerator.Current ==
null)
88 _needsMoveNext =
true;
92 if (collection ==
null)
95 var current = _enumerator.Current;
96 collection = CreateCollection(_symbol, current.Time, current.EndTime);
99 if (collection.
EndTime != _enumerator.Current.EndTime)
102 _needsMoveNext =
false;
103 if (IsValid(collection))
114 Add(collection, _enumerator.Current);
115 _needsMoveNext =
true;
119 return _liveMode || collection !=
null;
149 object IEnumerator.Current
160 _enumerator.Dispose();
188 if (_symbol.HasUnderlying && _symbol.Underlying == current.
Symbol)
191 if (baseDataCollection !=
null)
193 collection.
Underlying = baseDataCollection.Data[0];
202 if (baseDataCollection !=
null)
205 if(baseDataCollection.Data.Count > 1)
207 collection.
Data = baseDataCollection.Data;
211 collection.
Data.Add(baseDataCollection.Data[0]);
215 collection.
Underlying ??= baseDataCollection.Underlying;
219 collection.
Data.Add(current);
231 return collection !=
null && collection.
Data?.Count > 0;