[飞狐] 箱体,随便加到指标里

2011-02-20 11:01:00来源:本站整理浏览:373

{箱体部分}
cc:=收盘价;
oo:=开盘价;
hh:=最高价;
ll:=最低价;
top:=最高价;
bot:=最低价;
xx[1]:=1;
kk:=1;
for i=1 to 序列数据量 do begin
条件函数 xx[i]=1 then begin
top[i]:=hh[i];
end;
条件函数 xx[i-1]=1 then begin
条件函数 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;
条件函数 xx[i-1]=2 then begin
条件函数 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;
条件函数 xx[i-1]=3 then begin
top[i]:=top[i-1];
条件函数 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;
条件函数 xx[i-1]=4 then begin
top[i]:=top[i-1];
条件函数 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;
条件函数 xx[i-1]=5 then begin
条件函数 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 序列数据量 do begin
条件函数 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;
条件函数 xx[j-1]=5  AND  xx[j]=1 then kk:=0;
kk:=kk+1;
end;
{箱体部分}
画分段线(top=向前引用(top,1),top),Color3399FF,linethick2;//箱顶
画分段线(bot=向前引用(bot,1),bot),Color3399FF,linethick2;//箱底
画柱线((top<>向前引用(top,1)or bot<>向前引用(bot,1))  AND  xx=1  AND  向前引用(xx,1)=5,top,bot,1,0),Color3399FF,linethick2;//左侧竖线
画柱线((top<>向后引用(top,1)or bot<>向后引用(bot,1))  AND  xx=5  AND  向后引用(xx,1)=1,top,bot,1,0),Color3399FF,linethick2;//右侧竖线

股票公式栏目导航

本类热门

相关公式