Hi everyone, 

I was trying to use rolling window to perform some comparison and i saw the official example demonstrating such possibility to comparing slice by slice. However, when i try to set the rolling window to 5 days long period and try to iterate all of them but failed. I have some confusion around rolling window, hope i could get some advise from you and help me to understand this object more. Thank you

self.window = RollingWindow[TradeBar](5) #setting up the 5days long rolling window

The first confusion is that I am not sure RollingWindow is an array, because when i try to use len(self.window), the error return and said it is not a type has len() function. In other words, it is not an array?

Runtime Error: TypeError : object of type '0, Culture=neutral, PublicKeyToken=null]]' has no len() at OnData in main.py:line 85 :: len(self.window) TypeError : object of type '0, Culture=neutral, PublicKeyToken=null]]' has no len()

The second confusion is, if rolling window is not an array then how can we able to access self.window[0] and works perfectly just ike the doc shown: 

https://www.quantconnect.com/docs/algorithm-reference/rolling-window#Rolling-Window-Combining-with-Indicators

The thrid confusion follow with the #2 is if it is an array then why can't i access self.window[:]? It will return error:

Runtime Error: Trying to dynamically access a method that does not exist throws a TypeError exception. To prevent the exception, ensure each parameter type matches those required by the arguments method. Please checkout the API documentation. at OnData in main.py:line 85 :: self.Log(self.window[:]) TypeError : No method matches given arguments

 

I'm apologize for I dont have any project/research code could share. All I'm doing is just within Initialize() and OnData().