Hi all I am working on a pluggable alpha model that returns indicators based on candlestick patterns (the one i am using here is a piercing candlestick) I am currently using a consolidator to pump equity information into my alpha model which then readds if the piercing candlestick exists in the most recent bar.
Let me know if anyone finds a solutino to my error code:
Runtime Error: TypeError : iteration over non-sequence TypeError : iteration over non-sequence
https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_7352381369d40b579ac1596905af0421.html
Shile Wen
Hi Nathan,
This error is caused when we don't return an iterable object for our Insights, which can be caused when we call a naked return (which returns a None object) or return an Insight object that isn't contained in a list. To address this, we need to make all return statements return a list. I've shown this fix in the attached backtest.
Best,
Shile Wen
Nathan Zeuch
Thanks once again for your help Shile! Do you know an easy way to access the most recent insight, I am using a candlestick strategy paired with a trailing stop loss risk management model. The insights that I am currently emitting all have a duration of 5 days. This is not working how I intended because once the stop loss is triggered, my algorithm immediately reinvests because I still have active insights. Is there a way to clear previous insights on liquidation or call the most recent insight so I can emit an insight from within my risk management model to show my portfolio constructor it should liquidate by calling on the most recent insight? Let me know if you have any solves for my problem thanks!
Shile Wen
Hi Nathan,
Please post the problem and the algorithm in a new thread as it's a different problem.
Best,
Shile Wen
Nathan Zeuch
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!