Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to roll multiple futures ?

Hello all,

I am still quite new and learning.
I managed to write a program to roll futures, but I am trying to optimize the code. Currently, I write codes for each individual future security. So if I am to have for example 10 different futures, I will have to write 10x rolling commands, which is not optimal.

I know the best way is to use a for loop, but I am still having difficulties understanding how it works in Python.
Can someone please help?

Thank you in advanced.