Hi guys, I am new to quantconnect and python. I am currently creating the first indicator to verify I can do it properly and I am getting the following error referencing line 15:
Duringthe algorithm initialization, the following exception has occurred: NotImplementedException : Indicator.Value must be implemented. Please implement this missing method in CustomSwingLow
Could anyone help me fix it and explain what I did wrong?
Cole S
Hi Jeremy,
If you attach a backtest it's easier for us to help. You can click “Attach Backtest” below the comment editor.
Looking at the code I'm guessing that self.Value = None is creating a new field that is hiding the Value field that already exists on indicator since you are inheriting PythonIndicator.
That's just a guess and may very well be wrong. You could try remove that line and see if it fixes anything.
-Cole
Fred Painchaud
Hi Jeremy,
Since you want to use RegisterIndicator, Cole is right and you need not to set self.Value to None. I do it all the time since I do not use RegisterIndicator and… it is a long story.
You won't have that error anymore once you remove it but make sure to also change your two lines:
self.Value == True
self.Value == False
to
self.Value = True
self.Value = False
or you will encounter some other problems. = is assignment, == is equality comparison.
Fred
Vladimir
Jeremy123
Cole S is right.
The best way to get help fast --> attach a backtest or a code snippet.
Here is my attempt to create working SwingLow Custom indicator.
Jeremy123
Sorry for the late response. Thank you so much Cole Fred and Vladimir!! I did not realize how helpful this forum and community is! Yes that fixed the error, thanks for the help guys. So simple lol. Also I will attach backtest next time.
Vladimir
Jeremy123
If you are satisfied with my answer, please accept it.
Fred Painchaud
I'm glad we helped Jeremy!
Fred
Jeremy123
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!