Hi Adam. I was able to make your code work with updated link for VIX. Great help!!!.The only modification I made was to add the following and it worked:
proxyhost="&proxy_host."
proxyport=&port

However, do you know how I can determine the period2 dynamically? We plan to extract the data every month for the whole history so while period1 is constant, period2 is changing. Is there a logic to figure it out ?