Back to Community
Rolling futures expiry w/ Continuous Futures

1) If I purchased a {X} month (or offset) continuous futures and didn't touch it at all, does Quantopian automatically roll the position over?

For example, suppose I bought a continuous_future("CL", offset=0, roll="calendar", adjustment="mul"), does it:

  • Sell the contract automatically on auto_close_date
  • Buy the next month
  • While keeping the notional exposure the same?

2) Is there any way to instantiate a the continuous futures contract that's rolled some {X} number of days prior to the auto_close_date?

3) Is the end_date of a futures contract the same thing as the expiry date (or the day before)?

Thanks in advance!

2 responses

I am also searching (urgently) for the above information. Can somebody help ? Also, is is possible to ... do .. say "i want to order this future, but i need to check if the expiry day is within X days, then please order the next month future instead." is this possible ?

There's no automatic rolling with continuous futures, just automatic closing. However, I put together an example that rolls contracts 2 days before the auto_close_date. You should be able to change the EARLY_CLOSE_DAYS variable in the example to whatever number of days you prefer, as described in your example above.

The end_date is the last day for which we have pricing data for a contract, while the expiry_date is sent to us as part of the meta data for the contract. The relative difference between the end_date and the expiry_date will likely vary between futures.

Let me know if this helps.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.