Have a question on the Piotroski F-Score Investing strategy by QuantConnect Team. I tried to change the rebalancing from daily to monthly, timedelta(days=30), but the buy/sells and rebalancing still occurs daily. Can you please advise how to modify the code so I can do the rebalancing monthly? Thanks.
Mia Alissi
To modify the rebalancing frequency to monthly in the Piotroski F-Score Investing strategy, you need to adjust the Portfolio Construction Model (PCM) and the Alpha Model.
In the Alpha Model, you need to add a condition to emit insights only once per month. You can do this by adding a property to keep track of the last month an insight was emitted and then check if the current month is different from the last month an insight was emitted. If it is, emit the insights and update the last month property. Here is an example of how you can do this:
In the Portfolio Construction Model, you need to remove the daily rebalancing and set it to None. Here is an example of how you can do this:
Finally, you need to change the insight duration to the end of the month. Here is an example of how you can do this:
Please note that these code snippets are based on the information provided in the knowledge sources and may need to be adjusted to fit the specific implementation of the Piotroski F-Score Investing strategy.
Knowledge sources:
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.
Brian Wittig
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!