Back

ADX/ATR History Bar Update in Universes

Hey guys, I was looking through one of the recent forum posts on using history to update indicator bars in the universes.  I ran the backtest and noticed that, while it ran, the log actually didn't output the correct data to use.  All of the ADX values were 50 and all of the ATR values were 0.  I'm not sure how to fix this to make it useable. 

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.


0

Hi Brad,

Thank you for your question. It is a really good observation. In fact, a missing argument in TradeBar caused this issue. It should be bar = TradeBar(tuple.Index, symbol, tuple.open, tuple.high, tuple.low, tuple.close, tuple.volume) rather than bar = TradeBar(tuple.Index, tuple.open, tuple.high, tuple.low, tuple.close, tuple.volume) in line 70. We should add the symbol of the equity when creating TradeBar. In this way, the ADX and ATR will get updated correctly and they are no longer always 0 and 50. Besides, I log the values of other indicators too (SMAv, SMA, and RSI). All of them get updated correctly and their values are reasonable.

Now, feel free to combine Universe Selection and different Indicators. We hope you can create some amazing algorithms based on this example. Good luck!

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.


Awesome! Thank you for the help!!!

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