Address reviews
- Reduce code duplication. Handle some missing History<TradeBar> for Tick resolution.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user