필터 지우기
필터 지우기

pairs trading strategy problem

조회 수: 1 (최근 30일)
alessandro caserta
alessandro caserta 2015년 2월 14일
good morning everyone
I'm developing a strategy of pairs trading. I found a part of a matlab on http://www.mathworks.com/matlabcentral/fileexchange/31060-cointegration-and-pairs-trading-with-econometrics-toolbox but I could not understand how it works
I don't understand how the final return is calculated in this part of the code.
r4 is the total return vector
'series' represents the prices of companies.
s(i:i+N-1, 2) = (res/reg1.RMSE > spread)- (res/reg1.RMSE < -spread); s(i:i+N-1, 1) = -reg1.coeff(2) .* s(i:i+N-1, 2);
r = sum([0 0; s(1:end-1, :) .* diff(series2) - abs(diff(s))*cost/2] ,2) title(['Final Return = ',num2str(sum(r4),3),'(',num2str(sum(r4)/mean(series2(1,:))*100,3),'%)'])
specifically I'd like to learn the reason of the division of sum(r4) to the mean.
(',num2str(sum(r4)/mean(series2(1,:))*100,3),'%)'])
thank you so much for your time and cooperation,
regards

답변 (0개)

카테고리

Help CenterFile Exchange에서 Transaction Cost Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by