The add_index("VIX", Resolution.MINUTE) can only provide daily resolution
I have tried following code but didn't work
self.vix_index_symbol = self.add_index("VIX", Resolution.MINUTE).Symbol
vix_option = self.add_index_option(self.vix_index_symbol, Resolution.MINUTE)
vix_option.set_filter(-2, 2, timedelta(0), timedelta(30))
self.vix_option_symbol = vix_option.Symbol
def OnData(self, data: Slice): chain = data.option_chains.get(self.vix_option_symbol)
if chain: vix_price = chain.underlying.price
self.log(f"current VIX price: {vix_price}")
else: self.log("not receiving VIX data")Logs:
2025-04-28 16:40:35 :not receiving VIX data2025-04-28 16:41:55 :not receiving VIX data2025-04-28 16:42:04 :not receiving VIX data
Mia Alissi
It seems the issue with the existing code was that the VIX index only supports daily resolution, not minute resolution. Here's the revised implementation that uses daily resolution for both the VIX index and its corresponding options:
Key Changes:
add_index
andadd_index_option
have been set toResolution.DAILY
.Now the code should function correctly according to QuantConnect's data availability and resolution constraints. Let me know if you need further adjustments or explanations!
Sources: Exploiting Term Structure Of Vix Futures, US Index Options - QuantConnect.com, Index Option Bear Call Spread Algorithm, Index Option Call Calendar Spread Algorithm, Basic Template Index Daily Algorithm
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.
Dengke Liu
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!