查看完整版本: 请高手解释这段程序

ykhlxcxa 2008-6-18 11:49

请高手解释这段程序

箱型区间操作指标
hh:=h;ll:=l;
top:=h;
bot:=l;
xx[1]:=1;
kk:=1;
for i=1 to datacount do begin
if xx[i]=1 then begin
top[i]:=hh[i];
end;
if xx[i-1]=1 then begin
if hh[i]>top[i-1] then begin
top[i]:=hh[i];
xx[i]:=1;
end;else begin
top[i]:=top[i-1];
xx[i]:=2;
end;
end;
if xx[i-1]=2 then begin
if hh[i]>top[i-1] then begin
top[i]:=hh[i];
xx[i]:=1;
end;else begin
top[i]:=top[i-1];
bot[i]:=ll[i];
xx[i]:=3;
end;
end;
if xx[i-1]=3 then begin
top[i]:=top[i-1];
if ll[i]< bot [i-1] then begin
bot[i]:=ll[i];
xx[i]:=3;
end;else begin
bot[i]:=bot[i-1];
xx[i]:=4;
end;
end;
if xx[i-1]=4 then begin
top[i]:=top[i-1];
if ll[i]<bot [i-1] then begin
bot[i]:=ll[i];
xx[i]:=3;
end;else begin
bot[i]:=bot[i-1];
xx[i]:=5;
end;
end;
if xx[i-1]=5 then begin
if ll[i]<bot [i-1] or hh[i] > top[i-1] then begin
top[i]:=hh[i];
bot[i]:=hh[i];
xx[i]:=1;
end;else begin
bot[i]:=bot[i-1];
top[i]:=top[i-1];
xx[i]:=5;
end;
end;
end;
for j=1 to datacount do begin
if xx[j]=5 and xx[j-1]=4 then begin
for k=j-1 downto j-kk do begin
top[k]:=top[j];
bot[k]:=bot[j];
end;
end;
if xx[j-1]=5 and xx[j]=1 then kk:=0;
kk:=kk+1;
end;

zjxte 2008-6-19 23:22

支持你!
[img]http://user2.55.la/user_pic/bannerpic/2008/06/17/18/88145.gif[/img]
页: [1]
查看完整版本: 请高手解释这段程序