I have no idea why my program place some order while no insight was emitted from the alpha model. My algorithm is simply EMA Crossover. But the program place long order at 2018-12-18 while no crossover occurs.
Beside that, the insight summary in result page doesn't show the insights emitted from alpha model when I set the resolution to be Resolution.Daily. But it shows when I set the resolution to be Resolution.Minute.
Many thanks for helping me!
Ki lam
I tried to change the insight period and the order closed before insight expired. May I ask is there any docs explain the logic for handling insight? Really wanna know the algorithm close the order under what situations.
Thanks!
Vladimir
Ki lam
Â
→ But the program place long order at 2018-12-18 while no crossover occurs.
Â
The program placed buy-to-cover order because you set duration of insight to 1 day
AlphaModel line 15Â self.period = timedelta(days=1).
If you will set self.period = timedelta(days=5).
The program will cover short position on sixth day,
Â
Ki lam
Hi Vladimir,
Thanks for answering me. Â I have tried to set the period to be 1000days, but the orders were closed in the third day.
Louis Szeto
Hi Ki
The solution of Vladimir should be correct, maybe you just use default PortfolioConstructionModel rebalancing time: it'll rebalance everyday to set the position as the exact number set in the insight (the positional percentage of your portfolio), so you can see some -1, +1 orders.
If you do not need to renew universe every some time, you can set rebalancing time and insight active time as the longest length you predict it would be. The backtest example I attached uses Expiry.EndOfYear. Then the portfolio will not renew by security updates, but just new insights update.
If you need to renew your universe, you maybe also use this line in your .initialize() method as your PCM
Cheers
Louis
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.
Ki lam
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!