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
Daniel Hai
Jared Broad
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.
JP B
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.Daniel Hai
Michael Handschuh
Daniel Hai
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!