请版主测试一下加入“跨周期引用”在5分钟图里画日开盘线,就能看到错误了!
INPUT:N1(0.2,0.1,100),N2(1,0,1),ZQ(6,-1,20);
fc:=c;
fo:=o;
cc:0*c,linethick0;
oo:0*c,linethick0;
t1:=0*c;
t2:=0*c;
for i=1 to datacount do begin
if i=1 and fc[i]>fo[i] then
cc[i]:=fc[i];
oo[i]:=fc[i];
if i=1 and fc[i]<fo[i] then
cc[i]:=fc[i];
oo[i]:=fc[i];
if i>1 then
cc[i]:=cc[i-1];
oo[i]:=oo[i-1];
if i>1 and fc[i]>cc[i]*(1+n1/100) then begin
cc[i]:=cc[i-1]*(1+n1/100);
oo[i]:=cc[i-1];
end;
if i>1 and fc[i]<oo[i]/(1+n1/100) then begin
oo[i]:=oo[i-1]/(1+n1/100);
cc[i]:=oo[i-1];
end;
if oo[i]=oo[i-1] then
t1[i]:=t1[i-1]+1;
if cc[i]=cc[i-1] then
t2[i]:=t2[i-1]+1;
end;
o1:=ref(oo,t1+1);
c1:=ref(cc,t2+1);
STICKLINE(c1=oo,cc,oo,8,1)COLORRED;
STICKLINE(o1=cc,cc,oo,8,1)COLORCYAN;
{加入跨周期引用画日开盘线}
QSX:=STKINDI('','KPX.开盘线',0,6); //引用KPX指标的任意(ZQ)周期开盘线;
DRAWSL(N2<>0,QSX,0,2,1),COLORFF00FF;
/////////
说明:引用的KPX指标内容
开盘线:OPEN;