function minusplus2CumulativeA(minusfilename,outfilename);
% Соединяет верхнюю и нижнюю линию и выводит средний график 
% параметры minusfilename,outfilename
minus=dlmread(minusfilename);
plusfilename=strrep(minusfilename,'_closeCumulateveA_minus_MarkovPrognoz_itog.txt','__closeCumulateveA_plus_MarkovPrognoz_itog.txt');
plus=dlmread(plusfilename);
if length(minus)>length(plus)
    minus=minus(1:length(plus));
end
if length(plus)>length(minus)
    plus=plus(1:length(minus));
end

A=(plus-minus)./(minus+plus);
figure;
plot(A);
title('A');
CumulativeA=[];
for i=1:length(A)
    CumulativeAi=sum(A(1:i));
    CumulativeA=[CumulativeA,CumulativeAi];
end
figure;
plot(CumulativeA);
title('CumulativeA');

dlmwrite(outfilename,CumulativeA,'\n');