Dear Community
My goal with this algorithm is to invest in 20 stocks with the highest dividend yield sorted from my universe and to rebalance monthly. I'm using the equal weighting portfolio model. My first idea was to emit insights monthly but the construction model would rebalance every day without rebalance function. After creating a monthly rebalancing function, my new problem would be that my monthly insights would rise over the year from 20 to 33. At the same time, my holdings and equity would differ at the rebalancing. I don't understand why my insights are rising and why not all of my Cash is being invested when rebalancing.
I would be glad if someone could help
Louis Szeto
Hi Julian
I think the problem of extra insights comes from this 3 lines here
As you didn't give the insight expiry of a month but a year (default daily resolution of 365 bars), when there's universe updated or new insight added, no rebalance happened: the older symbols' insights will not liquidate, it will also stay in your ActiveSecurities.
Â
Actually there is a good solve, by using Expiry.EndOfMonth in your PortfolioConstructionModel and Insight to emit insights that last till end of month and only update Portfolio at the time. And dun change the universe to prevent rebalance before expiry. I attached an exmaple.
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.
Julian
Thank you!
Julian
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!