Hi folks,
I have created 15 min consolidated trade bars and I'm looking to create a RollingWindow of SMA based off this consolidated data.
My consolidation appears to be working but I can't seem to get the RollingWindow of SMAs working.
The Error suggests the RollngWindow is expecting a diff data structure but can't figure out what i'm doing wrong here.
Runtime Error: Trying to dynamically access a method that does not exist throws a TypeError exception. To prevent the exception, ensure each parameter type matches those required by the 'QuantConnect.Indicators.SimpleMovingAverage'>) method. Please checkout the API documentation.Any help would be greatly appreciated
Mia Alissi
Based on the error message and the code you provided, it seems like the issue is with the data type you're trying to add to the RollingWindow. The RollingWindow is expecting an IndicatorDataPoint, but you're trying to add an instance of SimpleMovingAverage.
In your code, you're trying to add the SMA object itself to the RollingWindow:
Instead, you should be adding the current value of the SMA, which is an IndicatorDataPoint. You can access this with the
Currentproperty of the SMA object:This should add the current IndicatorDataPoint of the SMA to the RollingWindow, which should resolve the error you're seeing.
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.
Tom Finney
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!