Back to Community
Futures don't automatically roll-over?

I guess I just assumed they would be rolled-over automatically; isn't this true? I thought part of the idea of implementing continuous_futures was to have a simple tool that does this.

3 responses

This backtest from Jamie has a roll example.

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.

Thanks for that Dan. In the mean time I went about coding my own roll, and I think your data.current_chain documentation isn't consistent with actual behavior. Here's what it says

Gets the current forward-looking chain of all contracts for the given continuous future which have begun trading at the simulation time.

However, on date auto_close_date itself the closest contract is still tradable, but isn't the first item on the list returned by data.current_chain.

Example. CLG14 has auto_close_date=2014-01-17. When I run data.current_chain on the "2014-01-16" I get [Future(1058201402 [CLG14]), Future(1058201403 [CLH14]), .... All good. However when I run it on "2014-01-17" I get [Future(1058201403 [CLH14]), Future(1058201404 [CLJ14]), .... I would have expected that since CLG14 is still tradable, it should be the first on the list.

Not a big deal, just unexpected.

Hi João,

The auto_close_dateof a contract determines when it is automatically closed out in the backtester. When that date hits, open positions are closed out, and new positions in that contract can't be opened. Because new positions can't be opened, the contract is removed from the 'current chain'. The thinking behind this is that data.current_chain would be used to get contracts for the purpose of opening new positions. Are you using it for a different purpose?

One common response we've received from the community is that the auto_close_date is too conservative (2 days before the earlier of the last traded date or first notice date). This isn't something that we plan to change in the near term, but we do plan to revisit it going forward.

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.