I am having a hard time figuring out how to use the history function to warm up my SMA indicator. Is there an example that shows how to warm up an indicator with historical consolidated data? I am currently able to call the History function. But I am having trouble consolidating the 1m history data into hour data for my SMA indicator.
I've attached a backtest.
Thx for the help.
Shile Wen
Hi Dean,
First, since we are on a minute resolution, we should register the SMA as an indicator. This means, instead of using self.SMA, we should use SimpleMovingAverage(10) and register the indicator using self.RegisterIndicator("EURUSD", self.SmaHigh, Resolution.Hour). Then, to warm up this indicator, we can use self.SetWarmup(10, Resolution.Hour). I’ve also made a few additional adjustments to the code. Please see the attached backtest for reference.
Best,
Shile Wen
Dean van Doorn
Thank you, I got it working now.
Dean van Doorn
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!