I'm writing an algorithm that will be monitoring futured tick level data (Specifically on /ZB). I would also like to have a 1 minute consolidator to capute the high/low for that period. I'm having trouble accomplishing this. Attached is code/backtest where I've commented out the two ways that I've tried to do this. Both of these throw errors:
//Add Future Contract
var futureBond30Yr = AddFuture(Futures.Financials.Y30TreasuryBond, Resolution.Tick);
futureBond30Yr.SetFilter(TimeSpan.Zero, TimeSpan.FromDays(182));
var oneMinute = new TickConsolidator(TimeSpan.FromMinutes(1));
//bind event handler to data consolidated event.
oneMinute.DataConsolidated += OnMinuteBar;
//register the consolidator for data. (Both of these throw errors)
//SubscriptionManager.AddConsolidator(Futures.Financials.Y30TreasuryBond, oneMinute);
//SubscriptionManager.AddConsolidator(futureBond30Yr.Symbol, oneMinute);
Also in thinking about this, sicne this is a future would this really need to pick the specific future contract that its monitoring ( /ZB next expiration for example), and if thats true then it would probably also need to reset the consolidator after futures roll..
I'm more of an options guy than a futures guy so some of this is new to me
Ray Bohac
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!