I am using this algorithm as a base to create my own and I still can't seem to get set holdings to work. Does anyone know why?
Thank you in advance!
QUANTCONNECT COMMUNITY
I am using this algorithm as a base to create my own and I still can't seem to get set holdings to work. Does anyone know why?
Thank you in advance!
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.
Jared Broad
There is no algorithm attached =)
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.
Riley James
Just attached it, I thought I did the first time but did not select a backtest. My bad.
Gurumeher Sawhney
Thanks for attaching the backtest! The reason why SetHoldings was not working was because the code was not being called. After Initialize() the algorithm finished running. In order to fix this the code in rebalance() was put inside OnData(), since OnData() is a built in handler that uses the initialized data. The Resolution of the data was set to Daily and there was no scheduled event calling rebalance(), so I assumed the rebalancing was meant to be called Daily. The backtest below has the algorithm built and running. If the rebalancing was supposed to occur at a different time the link below has documentation on how to implement that:
Riley James
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!