Hello,
I'm looking for hints on how to debug a problem with my backtest. The algorithm is in python. The backtest runs all the way from 2005 to 2020, and then fails with this error dialog:
There is no stacktrace. And this way of presenting the error message makes it impossible to see what the algorithm had been doing when the failure occurred.
I downloaded the logs. And the logs end with this:
2020-01-01 00:00:00 Data for symbol XP has been limited due to numerical precision issues in the factor file. The starting date has been set to 12/10/2019.
2020-01-01 00:00:00 Data for symbol XP has been limited due to numerical precision issues in the factor file. The starting date has been set to 12/10/2019.
2020-01-01 00:00:00 Runtime Error: Trying to retrieve an element from a collection using a key that does not exist in that collection throws a KeyError exception. To prevent the exception, ensure that the key exist in the collection and/or that collection is not empty. KeyError : (,)
2020-01-01 00:00:00 Algorithm Id:(d4979ac81b41ee413577b3dd4339067c) completed in 5719.30 seconds at 6k data points per second. Processing total of 34,140,354 data points.
Trying to run the algorithm in debug mode to try and catch the failure is impractical. How can I get some information about what's failing so that I can fix the problem? I've tried running the algorithm for a shorter duration, and the algorithm completes without problems. I've attached the backtest result below. And while the results show here, they do not show in the algorithm development environment.
Sunil
Sunil Mishra
Something changed last night. I am now getting stack traces and have been able to debug my algorithm. And the python stacktraces were actually python stacktraces!
Now, if only error messages would not completely replace the current execution state...
Sunil
Â
Jared Broad
Sorry about that Sunil, we fixed the issue yesterday. We've heard the feedback about the backtest interface and will try and make it keep the previous backtest up in a runtime error.
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.
Sunil Mishra
Thank you Jared. Looking forward to it!
Â
Sunil Mishra
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!