Can the RenkoConsolidator be used with Futures?
The SubscriptionManager with the RenkoConsolidator is declared in the Initialized method. Yet, in the OnData method, we use code to determine the most liquid up-front contract to get the last price. Not sure how to pump the last price into the RenkoConsolidator when the SubscriptionManager is declared in the Initialized method.
Rahul Chowdhury
Hey Michael,
The SubscriptionManager adds the consolidator to the algorithm to receive data from a symbol. The SubscriptionManager then keeps a reference of the consolidator so that we can add or remove it from receiving data from that symbol.
In general, we don't need to update the SubscriptionManager with price data; the consolidator will be automatically updated after we've subscribed it to data from a symbol. Once we declare our consolidator, we can access it with its pointer from anywhere within the QCAlgorithm class.
However with futures, things are bit different because continuous futures contracts aren't supported yet. This means if your consolidator is tracking the front month contract, once that contract expires, the consolidator will not be receiving price data from the new front month contract.
What we can do to work around this is to create a RenkoConsolidator which does not receive data from any symbol. We can then manually update the RenkoConsolidator with price data from the front month contract. As each front month contract expires, we'll replace it with the next front month contract.
I wrote an example which demonstrates this in action.
Michael Bloomfield
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!