Hi,
When I try to run the backtest I get an error on this line:
self.high.append(slice.High)
Error message:
Runtime Error: Python.Runtime.PythonException: AttributeError : ‘unicode’ object has no attribute ‘High’
Did I miss something ?
Thanks
Chris
QUANTCONNECT COMMUNITY
Hi,
When I try to run the backtest I get an error on this line:
self.high.append(slice.High)
Error message:
Runtime Error: Python.Runtime.PythonException: AttributeError : ‘unicode’ object has no attribute ‘High’
Did I miss something ?
Thanks
Chris
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.
Jing Wu
Hi Chris, sorry about the confusion. The old version dual thrust algorithm doesn't work on Lean anymore. I've updated the backtest, please check the updated tutorial page or the algorithm attached here.
Chris D
Perfect. Thank you very much Jing.
David luo
Why in this algo, only selltrig is used? buytrig is not used at all. I thought in the documentation, it says when price > cap, enter long position, when price < floor, enter short position.
if self.Portfolio[self.syl].Price >= self.selltrig:
elif self.Portfolio[self.syl].Price < self.selltrig:
David luo
I think there are mistaks in the codes of the tutorial.
Jack Simonson
Hi David,
Thanks for bringing this to our attention. I've made the necessary changes and opened a Pull Request in GitHub to merge the changes, which you can view here.
Parker
With the updated code I still get the following error when paper trading:
Â
TypeError : '>=' not supported between instances of 'float' and 'NoneType' at OnData
Â
Jack Simonson
Hi Parker,
Generally, a NoneType occurs when the symbol being traded doesn't occur in a data slice, usually due to a data event such as a Dividend, Split, or other. I've modified the code to check for this and you can view the pull request at GitHub here. I've attached the modified backtest so you can view this check at the top of the OnData() method.
Chris D
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!