python3 -c "import urllib.request,csv,io,datetime,math;U='https://cdn.cboe.com/api/global/us_indices/daily_prices/';fs={'VIX':'VIX_History.csv','GVZ':'GVZ_History.csv','OVX':'OVX_History.csv'};d={}; for k,f in fs.items(): r=csv.reader(io.StringIO(urllib.request.urlopen(U+f).read().decode()));next(r);d[k]={datetime.datetime.strptime(x[0],'%m/%d/%Y').date():float(x[-1]) for x in r if len(x)>1 and x[-1]} fn=lambda x,y: sum((a-sum(x)/len(x))*(b-sum(y)/len(y)) for a,b in zip(x,y))/(sum((a-sum(x)/len(x))**2 for a in x)*sum((b-sum(y)/len(y))**2 for b in y))**.5 for a,b in [('2010-03-12','2020-02-13'),('2020-02-14','2020-08-06'),('2020-08-07','2021-02-26')]: s=datetime.date.fromisoformat(a);e=datetime.date.fromisoformat(b);ix=[t for t in sorted(set.intersection(*[set(z) for z in d.values()])) if s<=t<=e];print('WIN',a,b,'N',len(ix)); for k in fs: z=[d[k][t] for t in ix];mx=max(z);print(k,'mean',round(sum(z)/len(z),3),'max',mx,'date',ix[z.index(mx)]); print('CORR',round(fn([d['VIX'][t] for t in ix],[d['GVZ'][t] for t in ix]),3),round(fn([d['VIX'][t] for t in ix],[d['OVX'][t] for t in ix]),3),round(fn([d['GVZ'][t] for t in ix],[d['OVX'][t] for t in ix]),3))"