%unploading data
data=load('data.txt');
cv=load('cv.txt');
copdepend=load('copuladependence.txt');
spotret=data(:,1);
futuresret=data(:,2);
spotcv=cv(:,1);
futurescv=cv(:,2);
for i=1:size(copdepend,1)
    convar(:,i)=copdepend(i)*sqrt(spotcv.*futurescv);
end
for i=1:size(copdepend,1)
hedgingratio(:,i)=convar(:,i)./futurescv;
    hedgingret(:,i)=spotret-futuresret.*hedgingratio(:,i);
end
kk=var(hedgingret);
kk=kk';
