37 _algorithm = algorithm;
60 bool? fillForward =
null,
61 bool? extendedMarketHours =
null,
64 int? contractDepthOffset =
null)
68 var dataType = subscription.
Type;
77 var fillForwardResolution = subscription.
FillDataForward ? resolution :
null;
78 if (fillForward !=
null)
80 fillForwardResolution = fillForward.Value ? resolution :
null;
85 startAlgoTz.ConvertToUtc(_algorithm.TimeZone),
86 endAlgoTz.ConvertToUtc(_algorithm.TimeZone))
90 FillForwardResolution = fillForwardResolution,
94 if (extendedMarketHours !=
null)
96 request.IncludeExtendedMarketHours = extendedMarketHours.Value;
99 if (dataMappingMode !=
null)
101 request.DataMappingMode = dataMappingMode.Value;
104 if (dataNormalizationMode !=
null)
106 request.DataNormalizationMode = dataNormalizationMode.Value;
109 if (contractDepthOffset !=
null)
111 request.ContractDepthOffset = (uint)Math.Abs(contractDepthOffset.Value);
136 DateTimeZone dataTimeZone,
138 bool? extendedMarketHours =
null)
140 return GetStartTimeAlgoTz(_algorithm.UtcTime, symbol, periods, resolution, exchange, dataTimeZone, dataType, extendedMarketHours);
159 DateTime referenceUtcTime,
164 DateTimeZone dataTimeZone,
166 bool? extendedMarketHours =
null)
168 var isExtendedMarketHours =
false;
172 if (extendedMarketHours.HasValue)
174 isExtendedMarketHours = extendedMarketHours.Value;
178 var configs = _algorithm.SubscriptionManager
179 .SubscriptionDataConfigService
180 .GetSubscriptionDataConfigs(symbol);
181 isExtendedMarketHours = configs.IsExtendedMarketHours();
185 var timeSpan = resolution.ToTimeSpan();
191 referenceUtcTime.ConvertFromUtc(exchange.
TimeZone),
194 isExtendedMarketHours,
197 return localStartTime.ConvertTo(exchange.
TimeZone, _algorithm.TimeZone);