I set the period for my insight as 30days
insight = Insight.Price(symbol, timedelta(days=30), InsightDirection.Up, None, None, None, 0.05)
However, it is found that the insight is indeed set for 14hours instead. May i know what's problem of my code? Thanks for advanced
Mia Alissi
Based on the provided code, there doesn't seem to be any issue with the way you're creating the Insight object. The code snippet you provided:
This is the correct way to create an Insight object with a period of 30 days, as shown in the Key Concepts section of the QuantConnect documentation.
If the Insight is being set for 14 hours instead of 30 days, the issue might be elsewhere in your code. It could be related to how the Insights are being used or updated in your Alpha Model or Portfolio Construction Model.
For example, in the
FixedWeightingPortfolioConstructionModel
class, theCreateTargets
method is called with the current insights. If the insights are being updated elsewhere in your code, this could potentially affect their period.Without more information or a more complete code sample, it's hard to pinpoint the exact issue. I would recommend checking other parts of your code to see if the Insights are being modified after they are created.
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.
Derek Melchin
Hi Enjolras,
The PCM cancels the insights when the security is removed from the universe. When insights are cancelled, it adjusts the period we see in the Insight Summary table. For more information, see Model Structure.
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.
Enjolras Leigh
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!