Back

How do I use consolidators with this kind of indicator?

Hello,

I'm trying to make ADX indicator to run with my custom H4 bars, I've checked the documentation here, but haven't found how to do this, I've done it previously with other indicators but ADX is different, so I get: "this is a forward-only indicator" error when trying to use RegisterIndicator.

I would appreciate some guidance, thanks.

https://www.quantconnect.com/tutorials/api-tutorials/consolidating-data-to-build-barshttps://www.quantconnect.com/tutorials/api-tutorials/consolidating-data-to-build-bars

 

https://www.quantconnect.com/terminal/#open/1558131
Update Backtest








The indicator should have been initialized using the following line:

ADX = new AverageDirectionalIndex(Crypto.Symbol, 20);

Because the indicator was not initialized correctly, it was not populating correctly. The documentation on consolidating data shows how the object should have been created. RegisterIndicator was used in the proper way so that was not the cause of the forward-only indicator error. The algorithm below is a working version of the one above:

1

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.


Thank you, Sawhney,

Question, when should I use ADX() method? I thought it was the same.

Thank you.

0

Update Backtest





0

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.


Loading...

This discussion is closed