Hi all, I finally figured out how to correctly use my candlestick alpha model with a single security but now i am looking to use the alpha model for a coarse universe using self.ActiveSecurities, could someone take a look at my backtest and tell me where I went wrong? Thanks!
https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_99bc26a9e66b39fd8ded356d940887af.html
Derek Melchin
Hi Nathan,
When setting up an candlestick pattern for each security in a dynamic universe, we should do so in the OnSecuritiesChanged method. This way, when securities are removed from the universe, we can remove the data subscription that is updating the candlestick pattern. I've shown how to do this in the attached backtest.
Notice that the stop loss logic has been removed from the alpha model. In the framework design, a stop loss is a responsibility of the risk management model. Refer to this related thread.
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.
Papa Bear
Big thanks ^
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!