Hey, I just wanted to say thanks in advance for the optimization. This is a valuable and fun addition to Quantconnect. I have an algo that compares a value to a number. Lets say the number is 15. If a slope of a line is < or > 15 then it would signal a trade. I would like to set up the code to run an optimization on the number 15.
I tried to add:
def Initialize(self):
self.GoShort = self.GetParameter("QQQShort")
And then on Ondata I used:
"self.GoShort.Current.Value" to try to have the optomizer fill in units into the single digit (in replace of the 15).
However, this is not working. The backtests all fail.
TypeError : '<' not supported between instances of 'float' and 'NoneType'
at OnData in main.py:
For the line with "self.GoShort.Current.Value"
Any thoughts?
Derek Melchin
Hi David,
The GetParameter method returns a string. Instead of calling `.Current.Value`, cast the value returned to an integer.
See the attached backtest for reference.
Best,
Derek Melchin
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.
David Eldringhoff
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!