I'm trying to better understand rolling windows, but experiencing two issues in my algorithm. The issues may be related.
The first issue is I'm unable to warmup the rolling window despite using self.Warmup(). This is shown in the “VIX” chart I've created, which is plotting the VIX from 21 days ago, pulling from the rolling window.
The second issue is that the first value shown on the chart on 3/1/2012 is showing the VIX price from 19 days prior, not 21 days prior. I would think it should be 21 days, not 19. I'm not sure what happened.
Thanks in advance for your help with this.
Bodhi
Here is the backtest.
Varad Kabade
Hi Patrick,
We ran the above backtest we did not encounter the issue. The last close on 2012-03-01 is the same as the current close on 2012-02-02. Note that we can check when our algorithm finishes warming up. In the attached backtest, we can see that it is finished on the StartDate.
Best,
Varad Kabade
Vladimir
Patrick,
You can also use
self.vix_days_ago = IndicatorExtensions.Of(Delay(days_ago), self.vix_price)
Bodhi
Thank you - your use of Delay() here is very helpful. What I don't understand is why VIX price, and also VIX from 21 days ago, doesn't register on the chart until 10 days into trading. Shouldn't those values populate on day 1 due to the warmup?
Vladimir
Patrick,
Try this one.
Bodhi
Thanks!
Bodhi
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!