Back

Need Help Getting VIX Data From Next Day

Hello

I need to write an algorithms that makes a decision based on end of day VIX data but during that day. So for example if today is Tuesday 3:55, how could I get the "would be" VIX close for that day at that time ? This is for testing purposes only, when live I already have a solution.

Thanks
Update Backtest








note that I am using daily VIX data
0

Hi Daniel, if this is for backtesting purposes then you could export VIX price data and re-tag its closing time to be Date-15:55. This of course won't be the exact price but it would be close enough.

Then you'd use the normal custom data API to import the VIX data as a CSV file.
0

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.


@Daniel Hai

If you really want the latest price (~15 min delay), you could of course do something like this:

public static void GetVIX()
{
string address = "http://www.google.com/finance/info?q=INDEXCBOE%3aVIX";
WebClient client = new WebClient();
string reply = client.DownloadString(address);
int start = reply.IndexOf("$");
int end = reply.IndexOf("\"", start);
VIX = Convert.ToDouble(reply.Substring(start+1, end-start-1));
Console.WriteLine("\n> Current VIX price:\t"+VIX+"\t("+DateTime.Now.TimeOfDay+")\n\n");
}


This would download the latest price of VIX from Google Finance.

Specifically, Google Finance's URL quote looks like this:

http://www.google.com/finance/info?q=INDEXCBOE%3aVIX

So very straightforward. I've attached a simple backtest to show you how it would work in QC. Take a look at the Console Log to see the current price of VIX, downloaded from Google Finance. Hope that helps you out.
2


Hey thanks, ye I will import it with a csv file.

My code was working fine, now im suddenly getting this error

Backtest Error: Error initializing algorithm: Please register to receive data for symbol 'YAHOO/INDEX_VIX' using the AddSecurity() function.

I have it loading

AddData("YAHOO/INDEX_VIX"", Resolution.Daily);

any suggestions ?
0

Hey Daniel, looks like a bug. We've located and fixed it and will deploy the fix shortly.

Thank you for your patience.
0

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.


Update Backtest





0

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.


Loading...

This discussion is closed