First time creating an algorithm from practically scratch using the QCAlgo framework so please, be gentle! I am wanting to consolidate to 5-minute bars and then use rolling windows to identify price action and emit an insight when identified. As of now, I cannot determine where to place self.window.Add(data[) in the algorithm. Attached is the code; the error received is:
No matter where I place this code, the error seems to persist, albeit relative to the new location. Suggestions?
James Hawkins
Apologies- i selected my algorithm to include but since there are no backtests due to the error, looks like it did not uplaod to the post. Here is the code:
Cole S
Hey James,
You are getting the error because you never instantiated the rolling window. You'll need something like:
Here's an example algorithm that uses RollingWindow as well.
James Hawkins
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!