Back

ADX Usage (Average Directional Index)

I am trying to implement this but having difficulty, it seems that the values only update after each new period is complete, instead of updating after each sample is added (with a rolling period). I have shown it below with a period of 3 for brevity.

AverageDirectionalIndex adx = new AverageDirectionalIndex(3);

09:35:00 READY? True VALUE: 50
09:36:00 READY? True VALUE: 50
09:37:00 READY? True VALUE: 50

09:38:00 READY? True VALUE: 75
09:39:00 READY? True VALUE: 75
09:40:00 READY? True VALUE: 75

09:41:00 READY? True VALUE: 50
09:42:00 READY? True VALUE: 50
09:43:00 READY? True VALUE: 50

09:44:00 READY? True VALUE: 65
09:45:00 READY? True VALUE: 65
09:46:00 READY? True VALUE: 65

09:47:00 READY? True VALUE: 80.12
09:48:00 READY? True VALUE: 80.12
09:49:00 READY? True VALUE: 80.12

09:50:00 READY? True VALUE: 89.48
09:51:00 READY? True VALUE: 89.48
09:52:00 READY? True VALUE: 89.48
Update Backtest








I see what is causing this now, I'll post a fix for this today! I love the ADX indicator.
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.


Hey @Kevin - I added a rolling queue to the ADX class and when it had more than 3 samples it starts using the windowed queue for the ADX calculation. I also put on a plot to show the ADX curve and it looks fairly realistic. The gaps in the ADX plot are from overnight. I'll work with Gustavo this week to hide the gaps (its a js chart setting).
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.


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