I have been trying to do something as simple logging of various variables. In can put them in debug statements without any problems. I am also able to use self.log for normal text
self.Debug(str(spy_price)) <-- works fine
self.log("test") <-- works fine
self.log(str(spy_price)) <-- throws an error
The error was AttributeError : 'ProportionalSimpleMovingAverage' object has no attribute 'log'.
And my class references QCAlgorithm
Can someone please explain why log entries cannot contain anything other than literal text? Are there other ways to get runtime data stored in the log files? The Debug window unfortunately doesn't provide the ability to go far enough back once the text scrolls off the window.
Douglas Stridsberg
Hi - the command you're looking for is self.Log, i.e. with a capital L. This command should handle whatever you throw at it :) .
P.S. Not sure how you made "self.log("test")" work, but I'm going to just ignore that one.
Mitch Christow
Thanks Douglas. I am a moron. As usual the problem was between the seat and the keyboard. Had a single typo in my code where I did indeed swap upper case and lower case L.
Mitch Christow
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!