I can't find any good examples or any documentation on how to rollover a contract for futures. I feel like this should be easier since its a pretty important part of futures trading. Maybe Im just missing something.
QUANTCONNECT COMMUNITY
I can't find any good examples or any documentation on how to rollover a contract for futures. I feel like this should be easier since its a pretty important part of futures trading. Maybe Im just missing something.
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Varad Kabade
Hi Sean Tiffen,
Refer to the following thread for more information on continuous futures. The same info will be updated on the docs soon.
Best,
Varad Kabade
Sean Tiffen
Thanks. Does this contract mapping transfer to live trading? Or would a separate roll over feature need to be created?
Varad Kabade
Hi Sean
We can access the mapped contract security object in live trading by self.continuous_contract.Mapped. For details, please refer to Live Trading Considerations part of the Future Security Master dataset page.
Best,
Varad Kabade
Simon David
Hi Varad
Louis Szeto
Hi Simon
Although a lot of brokers provide “continuous future” for trading, here is no real future continuous contract in financial market. They are just helping you to roll over the contract. Continuous contract is a pseudo-contract that created for fair historical lookback examination.
Best
Louis
Brandon
Anyone who live trades physically settled futures and use continuous future for signal generation?
Most brokers, such as Interactive Brokers or TradeStation, will force liquidate physically settled futures many days prior to expiry.
LEAN currently supports the following DataMappingMode options for continuous futures: OPEN_INTEREST, OPEN_INTEREST_ANNUAL, LAST_TRADING_DAY, FIRST_DAY_MONTH. All these options are great, though they do not allow the user to specify "roll N business days before expiry" with N as a user-configurable integer per instrument.
The issue with this limitation is that users running physically-delivered futures live on IBKR or TradeStation have no clean way to ensure rollovers happen before broker liquidation. The current workarounds (manually liquidating and opening the next contract on a scheduled basis) bypass LEAN's continuous contract machinery, which means the back-adjusted continuous price series used for signals can become inconsistent with the actually-held contract. This can have sizeable effect in futures markets, especially for commodity futures.
How do fellow QC traders manage this limitation?
Best regards,
Brandon
Sean Tiffen
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!