Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Futures PNL Help

Hi all, I am relatively new to Quantopian and coding and am trying to run backtests on many different futures. I wanted to see and compare the PNL of each different future but my current code isn't accounting for the roll and is only plotting the first futures expiration traded. I used the below post to get started but can't figure out the proper syntax to calculate the returns for the whole asset rather than each expiration. If anyone has run into this problem or knows a work around that'd be greatly appreciated. Thank you!

https://www.quantopian.com/posts/record-pnl-per-stock