קושיה מי שפותר רילוקיישן ועבודה מובטחת
if we reject the null hypothesis that no cointegrating relationship exists.
% The strategy:
% 1. Compute residuals over previous N mins
res = series2(i-N+1:i, 1) ...
- (reg1.coeff(1) + reg1.coeff(2).*series2(i-N+1:i, 2));
% 2. If the residuals are large and positive, then the first series is likely to decline vs. the second series. Short the first series by a scaled number of shares and long the second series by 1 share. If the residuals are large and negative, do the opposite.
if we reject the null hypothesis that no cointegrating relationship exists.
% The strategy:
% 1. Compute residuals over previous N mins
res = series2(i-N+1:i, 1) ...
- (reg1.coeff(1) + reg1.coeff(2).*series2(i-N+1:i, 2));
% 2. If the residuals are large and positive, then the first series is likely to decline vs. the second series. Short the first series by a scaled number of shares and long the second series by 1 share. If the residuals are large and negative, do the opposite.