I am manually updating the consolidator with hour bars to make 4 hour bars. Works as intended with only passing the consolidated tradebar into the first indicator then the tradebar rolling window. Passing it into a second indicator breaks the algorithm. Seems strange that this would cause problems.
anyone have any ideas? Thanks
# This works
def consolidator_handler(self, sender, tradebar):
self.indicatorOne.Update(tradebar)
self.tradebar_window.Add(tradebar)
# This doesn't work
def consolidator_handler(self, sender, tradebar):
self.indicatorOne.Update(tradebar)
self.indicatorTwo.Update(tradebar)
self.tradebar_window.Add(tradebar)
Fred Painchaud
Hi Brian,
If “indicatorTwo” is completely independent of “indicatorOne” and if neither is registered to automatically receive updates, it should indeed be working fine.
Would you please post simple but complete code that exhibits the wrong behavior?
Cheers,
Fred
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.
Brian Fontenot
Hi Fred thanks for the answer. I've attached a backtest of the algorithm. The indicators are a little contrived but exhibit the behavior I'm talking about. If you comment out the second indicator and its associated lines the algorithm will work. It could be something else causing the problem but I don't see it off hand. Take a look if you have a minute . Thanks
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.
Brian Fontenot
Here is the second version with just one indicator that is working
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.
Fred Painchaud
Hi Brian,
IndicatorOne should read:
But I believe the issue lies in your IndicatorTwo never becoming ready. You should debug to make sure it gets enough bars from the history call and is ready before the Alpha begins.
Fred
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!