Address reviews

- Reduce code duplication. Handle some missing History<TradeBar> for Tick
  resolution.
This commit is contained in:
Martin Molinero
2020-06-09 19:23:51 -03:00
parent a3c5fd9871
commit 170d12859f
3 changed files with 17 additions and 21 deletions
+4 -4
View File
@@ -734,8 +734,8 @@ namespace QuantConnect.Algorithm
var res = GetResolution(x, resolution);
var exchange = GetExchangeHours(x);
var start = _historyRequestFactory.GetStartTimeAlgoTz(x, periods, res.Value, exchange);
return _historyRequestFactory.CreateHistoryRequest(config, start, Time.RoundDown(res.Value.ToTimeSpan()), exchange, res);
var start = _historyRequestFactory.GetStartTimeAlgoTz(x, periods, res, exchange);
return _historyRequestFactory.CreateHistoryRequest(config, start, Time.RoundDown(res.ToTimeSpan()), exchange, res);
});
return PandasConverter.GetDataFrame(History(requests.Where(x => x != null)).Memoize());
@@ -796,8 +796,8 @@ namespace QuantConnect.Algorithm
if (resolution == Resolution.Tick) throw new ArgumentException("History functions that accept a 'periods' parameter can not be used with Resolution.Tick");
var res = GetResolution(symbol, resolution);
var start = _historyRequestFactory.GetStartTimeAlgoTz(symbol, periods, res.Value, GetExchangeHours(symbol));
var end = Time.RoundDown(res.Value.ToTimeSpan());
var start = _historyRequestFactory.GetStartTimeAlgoTz(symbol, periods, res, GetExchangeHours(symbol));
var end = Time.RoundDown(res.ToTimeSpan());
return History(type, symbol, start, end, resolution);
}