First off, I know this is an overfitted strategy catered to the recent volatility, but I am just using it as practice for learning python, using pandas, and flushing out ideas.
Can someone help me understand if this stratgey is suffering from look ahead bias by using the VIX Close as opposed to Open?
Looking at the research notebook attached, there is an obvious correlation between the daily change in VIX Close and the SPY close, but that is using the VIX Close of the same day as the SPY Close and therefore is unrealistic due to it not being known until after the trading day ends.
What is less obvious to me, is which VIX Close value is being used in the attached strategy (yesterday's, or today's (which would imply a looh ahead bias)) since the trades take place in the beginning of the day. It is my understanding that the VIX Close for the current trade date is not known yet and therefore the percentage change used in the strategy does not have any look ahead bias, but I cant say this with a lot of confidence. Any input or iterations from the community would be appreciated.
Kyle sn
Sorry, I realized an outdated research notebook was attached with the backtest in the original post. Attached should be the updated research notebook.
Derek Melchin
Hi Kyle,
Great start! QuantConnect/Lean does not have allow look-ahead bias. As was mentioned above, the VIX data is only sent to the algorithm after the sampling period has completed. That is, the VIX close sent to OnData is yesterday's close. I recommend checking out our documentation on Understanding Time to solidify this concept.
Best,
Derek Melchin
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.
Kyle sn
Thanks, Derek.
So if I understand correctly, if I want to analyze the relationship between the VIX and SPY in the research environment, I should be comparing the SPY close to the yesterday's VIX close to replicate the logic in the trading algorithm (which uses yesterday's VIX close)?
Kyle sn
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!