You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can loop through the results after calling GetTradingDays.
trading_days_obj = self.TradingCalendar.GetTradingDays(datetime(2020, 4, 28), datetime(2020, 4, 10))
days = [x for x in trading_days_obj]
Actual Behavior
Looping through trading_days_obj throws
Runtime Error: ArgumentOutOfRangeException : Specified argument was out of the range of valid values. (Parameter 'count')
at System.Linq.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument)
at System.Linq.Enumerable.Range(Int32 start, Int32 count)
at QuantConnect.TradingCalendar.PopulateTradingDays(DateTime start, DateTime end)+MoveNext() in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Common/TradingCalendar.cs:line 83
at Python.Runtime.Iterator.tp_iternext(IntPtr ob)
at
days = [x for x at trading_days_obj]
File "main.py" in main.py:line 12
ArgumentOutOfRangeException : Specified argument was out of the range of valid values. (Parameter 'count')
at System.Linq.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument)
at System.Linq.Enumerable.Range(Int32 start, Int32 count)
at QuantConnect.TradingCalendar.PopulateTradingDays(DateTime start, DateTime end)+MoveNext() in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Common/TradingCalendar.cs:line 83
at Python.Runtime.Iterator.tp_iternext(IntPtr ob) (Open Stacktrace)
Potential Solution
N/A
Reproducing the Problem
Run this algorithm
class TestingAlgorithm(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2020,4,29)
self.SetEndDate(2020,5,6)
self.SetCash(100000)
self.UniverseSettings.Resolution = Resolution.Daily
self.aapl = self.AddEquity("AAPL")
def OnData(self, data):
trading_days_obj = self.TradingCalendar.GetTradingDays(datetime(2020, 4, 28), datetime(2020, 4, 10))
days = [x for x in trading_days_obj]
System Information
QC Cloud
Checklist
I have completely filled out this template
I have confirmed that this issue exists on the current master branch
I have confirmed that this is not a duplicate issue by searching issues
I have provided detailed steps to reproduce the issue
The text was updated successfully, but these errors were encountered:
Expected Behavior
We can loop through the results after calling GetTradingDays.
Actual Behavior
Looping through
trading_days_obj
throwsPotential Solution
N/A
Reproducing the Problem
Run this algorithm
System Information
QC Cloud
Checklist
master
branchThe text was updated successfully, but these errors were encountered: