18 using System.Collections.Generic;
71 _algorithm = algorithm;
72 _resultHandler = resultHandler;
73 _mapFileProvider = mapFileProvider;
74 _factorFileProvider = factorFileProvider;
75 _dataProvider = dataProvider;
85 enablePriceScaling:
false);
103 var enumerator = _subscriptionFactory.
CreateEnumerator(request, _dataProvider);
116 IEnumerator<BaseData> enumerator;
123 IEnumerator<BaseData> warmupEnumerator =
null;
124 if (warmupRequest.TradableDaysInDataTimeZone.Any()
126 &&
LeanData.
IsValidConfiguration(warmupRequest.Configuration.SecurityType, warmupRequest.Configuration.Resolution, warmupRequest.Configuration.TickType))
134 warmupRequest.Configuration.DataTimeZone,
137 if (pivotTimeUtc < warmupRequest.StartTimeUtc)
139 pivotTimeUtc = warmupRequest.StartTimeUtc;
144 warmupEnumerator =
new FilterEnumerator<BaseData>(warmupEnumerator, data => data ==
null || data.EndTime <= warmupRequest.EndTimeLocal);
150 normalEnumerator =
new FilterEnumerator<BaseData>(normalEnumerator, data => data ==
null || data.EndTime >= warmupRequest.EndTimeLocal);
153 enumerator =
new ConcatEnumerator(
true, warmupEnumerator, normalEnumerator);
188 _marketHoursDatabase,
230 if (schedule !=
null)
245 var underlyingMarketHours = _marketHoursDatabase.
GetEntry(underlyingSymbol.ID.Market, underlyingSymbol, underlyingSymbol.SecurityType);
249 isUniverseSubscription:
false,
253 exchangeTimeZone: underlyingMarketHours.ExchangeHours.TimeZone));
255 var underlying = createEnumerator(underlyingRequests, fillForwardResolution);
277 Log.
Trace(
"FileSystemDataFeed.Exit(): Start. Setting cancellation token...");
278 _subscriptionFactory?.DisposeSafely();
279 _cacheProvider.DisposeSafely();
280 Log.
Trace(
"FileSystemDataFeed.Exit(): Exit Finished.");
321 if (fillForwardResolution !=
null && fillForwardResolution !=
Resolution.Tick)
324 fillForwardSpan =
Ref.Create(fillForwardResolution.Value.ToTimeSpan());