Hello all,
I am trying to import custom futures commodities data (locally) for some simple buy and hold strategy that will include rollover. Could someone give me some guidance on that as I could not find something relevant? I have managed to work with a simple contract import it and manipulate it but I am not sure on how to proceed when I have data of front, second month contracts etc together with all specific contracts and expiration dates.
Many thanks,
Grigoris
Mia Alissi
Hello Grigoris,
To import custom futures commodities data, you can use the
AddData
method in QuantConnect. This method allows you to import custom data from various sources. Here is an example of how to use it:(Source: Commodities Futures Trend Following)
For handling rollovers, positions are not rolled over automatically in QuantConnect. You will have to handle this manually. You can refer to this basic template algorithm which demonstrates how to roll over the position.
For resetting the indicators when there is a change in contract, you can follow a similar pattern as demonstrated in the same algorithm.
I hope this helps! Let me know if you have any other questions.
(Source: Continuous Futures Support)
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.
Paula Ten
Hello Grigoris Pachis !
I am currently facing the same situation that you described, it is being a difficult task due to the situation you mention: there are no implemented examples. Also, in my case at least, the QuantConnect Futures Fill model does not work with my Custom Data Securities. How do you handle your homework? Could you help me please?
Thank you.
Grigoris Pachis
Hi Paula,
Unfortunately I couldn't find anything. Only a not so relevant discussion in discord. Apparently you need to create your own excel files in order to do that. So I dropped it as it will be much easier to do the backtesting myself to be honest rather than spending so much time to make this work and eventually fail. I am sorry for not being able to help more.
Best,
Grigoris
Grigoris Pachis
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!