Guys, it's real hard to get decent example code showing how to add indicators to Futures. For example, I really can't find a way to get Average True Range Data (Bar Indicator) to work with a continuous future contract. I've seen how to use a Simple Moving Average (Data Point Indicator).
Can someone please point me in the direction of an example of using Bar Indicators with a continuous futures contract? Or can someone better than me create an example so I have a reference point?
Kind Regards,
Akira
Akira
For anyone seeking similar help, I got some example code to work. I'll attach the backtest here as a reference to help anyone out there having similar problems as I did. In this backtest, th logs will show that ATR and Donchian Data is working.
Scott Schoolmeyer
Thanks. I'm new to the platform. When the contract rolls, I believe it gives an error where it doesn't have the data. Do you have to redo the history for the data in the on_data method for each new contract roll?
Akira
Hey Scott,
The algorithm handles the data for the associated indicators on roll over automatically, based on my tests so far at least. I will share a link to the QuantConnect GitHub that helped me with the code for Futures, hopefully it can add more value to you as I am not the best of programmers.
Link: In the ‘Basic Template’ part of the list you will find different types of Futures Algos which have recently been updated to Pep 8 styling. I hope this helps even more than I can.
Scott Schoolmeyer
Thank you, it may just be a warning
Akira
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!