So I'm getting a bit of an issue, I have code setup for SetContract that works well with my ES futures but when I try to add the VIX futures I get an error:
Runtime Error: The string must be splittable on space into two parts. in SecurityIdentifier.cs:line 719
in Initialize:
vix = AddFuture(Futures.Indices.VIX,
fillDataForward: true,
resolution: Resolution.Daily,
dataNormalizationMode: DataNormalizationMode.Raw,
extendedMarketHours: true,
dataMappingMode: DataMappingMode.OpenInterest,
contractDepthOffset: 0);
My other futures are ES with a second resolution at this moment with the same settings otherwise.
At the beginning of OnData I call Set Contract which has the following in it (right below where I have my other contract swap but without any other logic).
vixcurrent = Securities[vix.Mapped];
vixcurrent_symbol = vixcurrent.Symbol;
And then at the end of Ondata I have:
Previous_vix = vixcurrent;
I don't have anything else interacting with VIX yet as I'm trying to just get the algo to run with a second subscription and this is farther than I've gotten before but can't get around it.
Echoes McCarthur
Please ignore. I ended up Finding a way out of this one by following the VIX dataset documentation. Should have seen that VIX is not treated the same as other futures before posting.
Daniel Russell
You can get the spot vix level on the minute resolution by using the at the money vix options at the minute resolution and taking the Underlying.Price.
I learned this from the forums and have attached a backtest in python for reference.
Echoes McCarthur
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!