I'm trying to debug and see what exactly slice looks like in the OnData method of the Algorithm.I've selected the Universe and I want to see what the data actually is.
So, I did the following:
def OnData(self, slice):
self.Debug(slice.Bars)
The backtest completed and I see nothing in the Console.I even tried to set a Breakpoint at that very same line. It stopped there, but again, nothing when I tried to actually access the data and see what looks like.
So, question is: How do I use any of these debugging tools?
Red Ghost
I also tried the following, since I read in Docs that it's a dictionary:
But the Logs don't show anything either.
Varad Kabade
Hi Red Ghost,
Please refer to the following youtube video we have uploaded on our channel on how to use the debugger tool.The algorithm can only log String values to log the items in data.Bars, we recommend typecasting them into a string using the str() method. Refer to the attached backtest.
Best,
Varad Kabade
Red Ghost
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!