18 using System.Collections;
19 using System.Collections.Generic;
33 private readonly IEnumerator<BaseData> _rawDataEnumerator;
36 private DateTime _nextTradableDate;
38 private bool _liveMode;
39 private DateTime? _endDate;
44 object IEnumerator.Current => Current;
69 IEnumerator<BaseData> rawDataEnumerator,
72 bool liveMode =
false,
73 DateTime? endDate =
null)
77 _nextTradableDate = DateTime.MinValue;
78 _rawDataEnumerator = rawDataEnumerator;
79 _factorFileProvider = factorFileProvider;
88 _rawDataEnumerator.Dispose();
100 var underlyingReturnValue = _rawDataEnumerator.MoveNext();
101 Current = _rawDataEnumerator.Current;
103 if (underlyingReturnValue
105 && _factorFileProvider !=
null
108 var priceScaleFrontier = Current.GetUpdatePriceScaleFrontier();
109 if (priceScaleFrontier >= _nextTradableDate)
111 _factorFile = _factorFileProvider.Get(_config.Symbol);
112 _config.PriceScaleFactor = _factorFile.GetPriceScale(priceScaleFrontier.Date, _config.DataNormalizationMode, _config.ContractDepthOffset, _config.DataMappingMode, _endDate);
115 _nextTradableDate = priceScaleFrontier.Date.AddDays(1);
123 Current = Current.Normalize(_config.PriceScaleFactor, _config.DataNormalizationMode, _config.SumOfDividends);
126 return underlyingReturnValue;
135 throw new NotImplementedException(
"Reset method not implemented. Assumes loop will only be used once.");