%x=load('x.txt');
%y=load('y.txt');
%data=[x y];
clear all; clc;
tic;
load data.txt;
data=data(:,1:2);
dccP=1;
dccQ=1;
archP=1;
garchQ=1;
windowlength=500;
for i=1:size(data,1)-windowlength
    fore(:,:,i)=DCCforecast(data(i:i+windowlength-1,:),dccP,dccQ,archP,garchQ);
end
for i=1:size(data,1)-windowlength
    hta(i)=fore(1,1,i);
    htb(i)=fore(2,2,i);
    htab(i)=fore(1,2,i);
end
    hta=hta';
    htb=htb';
    htab=htab';
    ratio=htab./htb;  
toc;
