I am running a back test, but it comes up error:
Runtime Error: ValueError : Input contains NaN, infinity or a value too large for dtype('float32').
at _assert_all_finite
msg_dtype if msg_dtype is not None else X.dtype)
File "validation.py" in validation.py: line 98
Here is the code:
self.stochastic.Update(bar)
prev_stochastic.append(float(self.stochastic.ToString()))
self.rsi.Update(tup.Index, tup.close)
prev_rsi.append(float(self.rsi.ToString()))
How can I fix it? Thanks
Varad Kabade
Hi Gary Li,
Please attach the complete code snippet/backtest for a precise diagnosis.
Best,
Varad Kabade
Gary Li
Hi Varad,
Thanks for your reply. I had that issue every time I ran the back test. I can't figure it out. Thanks for your help.
Regards
Gary
Alexandre Catarino
Hi Gary Li ,
Thank you for the backtest. However, we were not able to reproduce the issue with this version.
What changes do we need to make to reproduce the bug? I have changed the `StartDate` but it was not sufficient.
Best regards,
Alex
Gary Li
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!