I am constantly referencing the boot camps. Here is the backtest and code for The Algorithm Framework.
- note: the lessons have been renumbered over time so they may not be consistent and may be duplicated.
QUANTCONNECT COMMUNITY
I am constantly referencing the boot camps. Here is the backtest and code for The Algorithm Framework.
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.
Vladimir
With the only changes to the code
self.SetStartDate(2017, 1, 12)
self.SetEndDate(2022, 1, 12)
self.SetCash(1000000)
I got Error Message:
Runtime Error: AttributeError : 'NoneType' object has no attribute 'AssetClassification'
at OnSecuritiesChanged
sectorCode = security.Fundamentals.AssetClassification.MorningstarSectorCode
===
at Python.Runtime.PyObject.Invoke(PyTuple args in main.py: line 74
Fred Painchaud
Hi Vladimir,
I also do get that error. It seems to mean that there is a bug in the data somewhere such that HasFundamentalData is true BUT Fundamentals returns None.
That can be prevented by changing OnSecuritiesChanged with this code:
It is time-consuming to debug and know which asset is affected as coarse uses CoarseFundamental objects and then the symbols you output are used to create Security objects which have the Fundamentals attribute…..
But the backtest should be submitted to support@quantconnect.com in my opinion so they can pinpoint the offending assets and fix them.
Fred
Greg Kendall
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!