Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Using Pipeline with US Futures Calendar

Hi everyone,

I'm currently working on a futures trading strategy involving a Pipeline to get US Equities data on the underlying and then trade the corresponding futures (using US Futures calendar). I keep getting the following error message:

"WrongCalendar: Futures cannot be traded on the US Equities calendar. If you would like to trade futures, please select the US Futures calendar from the dropdown and re-run the backtest. If you want to trade futures at a particular time relative to equity market open or close, you can use schedule_function and specify a calendar=calendars.US_EQUITIES argument."

It's basically asking me to specify the calendar argument inside my schedule_function so that I only trade futures when the US Equities market is open, and I've done exactly that, but I still keep getting the same error. Has anyone had a similar issue before or figured out a workaround for it?

Thanks!

1 response

You should change your universe in the simulation

https://1drv.ms/u/s!Apb0NoJySfpFti6IUTd8XqNq9aoQ

See the image, that is your problem. I was having the same issue.

Regards