Hi guys, I'm trying to identify the cause of the closing order filled on the 2005-1-21. The alpha model did not emit any new signals once it went long in the market around 2004-08 and I was not expecting it to flatten until the SMA casued ‘TurningDown’ to become True. I'm currently debugging the algorithm and the activeinsights variable gets cleared for some reason and so this results in target weights ending up to be 0 around that time [2005-1-21.] . I am failing to understand why the algorithm would be setting the active insights to empty, given that I am long in the market and hte flattening condition has not been met. I have tried stepping through while setting the rebalancing parameter to None, within the equal weighting construction model but that doesn't seem to fix matters. What mechanism is causing the activeinsights object to become a length(0) please? . Any ideas would be hugely helpful. Many thanks, Alun
Mia Alissi
Based on the information provided in the extracts, it's not entirely clear why the
activeInsights
variable would be cleared in your algorithm. However, there are a few possibilities that could be causing this issue:Insight Expiration: In QuantConnect, Insights have a duration and they expire after this duration. If no new Insights are generated and the old ones expire, the
activeInsights
list would be empty. You might want to check the duration of your Insights and when they are expected to expire.Portfolio Rebalancing: In the EqualWeightingPortfolioConstructionModel, the portfolio is rebalanced based on the active Insights. If the Insights go flat/down, the model should re-shuffle the capital to be fully allocated to the remaining active insights assets. If this is not happening as expected, it could be a potential issue.
Risk Management: If you have a Risk Management model that uses stop loss logic, it could be generating
PortfolioTarget
objects with a 0 quantity, causing the Execution model to liquidate your positions. This could potentially clear youractiveInsights
.Universe Selection: If the Universe Selection model is removing securities from the universe, and you are not emitting flat Insights for these removed securities, they could be removed from
activeInsights
.Without more specific information about your algorithm and its behavior, it's hard to provide a more precise answer. I would recommend checking these aspects in your algorithm to see if they could be causing the issue. If the problem persists, you might want to consider reaching out to the QuantConnect community or support for more specific help.
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.
Alun Thomas
I can see that the insights have expired. In that case, how do I a) extend this or b) switch this functionality off within the algorithm? I dont want the insights to expire.
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!