Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Custom Factor question

Hello,
Karen Ruben originally shared below algo. I am very hard time understanding one line (line 41). How could denominator be 60 days old data? Could anyone explain to me how the data is arranged when you get "window_length = 60"? Thank you

3 responses

In numpy array indexing, [0] is the top row and [-1] is the bottom row. If it's 60 days of data, arranged oldest to newest, the newest is at the bottom at [-1] and the oldest, 60 days old, is at the top, at [0].

Simon,
Then is the oldest called as [-60] or [0]? Would either work in this case?
Ujae

Should be equivalent yeah.