谢谢原野朋友来交流和原码!向你学习!

前几天CWY朋友说上次代码有误,我也试着重新做了个,看来看去和软件自带的还是有点区别的,就是没找到毛病,估计是定义上有点小区别了。刚才粗看了下你的鬼变脸,和我的鬼变脸也有些区别。也贴出来和你交流!
复制内容到剪贴板
代码:
c1:=c;o1:=o;
ss1:max(c1,o1),LINETHICK0;
xx1:min(c1,o1),LINETHICK0;
zz1:0*c,LINETHICK0;
y:=if(c>o,1,0)+if(c<o,4,0),LINETHICK0;
for i=2 to datacount do begin
if y[i-1]=1 or y[i-1]=0 then begin
if c1[i]>ss1[i-1] then begin
ss1[i]:=c1[i];
xx1[i]:=ss1[i-1];
zz1[i]:=0;
y[i]:=1;
end;else
if c1[i]<xx1[i-1] then begin//=
ss1[i]:=xx1[i-1];
xx1[i]:=c1[i];
zz1[i]:=ss1[i-1];
y[i]:=4;
end;else begin
ss1[i]:=ss1[i-1];
xx1[i]:=c1[i];
zz1[i]:=0;
y[i]:=1;
end;end;
if y[i-1]=4 or y[i-1]=0 then begin
if c1[i]<xx1[i-1] then begin
ss1[i]:=xx1[i-1];
xx1[i]:=c1[i];
zz1[i]:=0;
y[i]:=4;
end;else
if c1[i]>ss1[i-1] then begin//=
ss1[i]:=c1[i];
xx1[i]:=ss1[i-1];
zz1[i]:=xx1[i-1];
y[i]:=1;
end;else begin
ss1[i]:=c1[i];
xx1[i]:=xx1[i-1];
zz1[i]:=0;
y[i]:=4;
end;
end;
end;
k1:=(y=1 and ref(y=1,1) and c>ref(ss1,1))*1;
k2:=(y=1 and ref(y=1,1) and c<=ref(ss1,1) and c>=ref(xx1,1))*2;
k3:=(y=4 and ref(y=1,1) and c<ref(xx1,1))*3;
k4:=(y=4 and ref(y=4,1) and c<ref(xx1,1))*4;
k5:=(y=4 and ref(y=4,1) and c<=ref(ss1,1) and c>=ref(xx1,1))*5;
k6:=(y=1 and ref(y=4,1) and c>ref(ss1,1))*6;
k7:=(y=1 and ref(y=0,1))*1;//6
k8:=(y=4 and ref(y=0,1))*4;
kk:if(barpos=1,y,k1+k2+k3+k4+k5+k6+k7+k8),LINETHICK0;
maxg:=max(max(ss1,xx1),zz1);ming:=min(min(ss1,xx1),zz1);
zxng:=(ss1<>maxg and ss1<>ming)*ss1+(xx1<>maxg and xx1<>ming)
*xx1+(zz1<>maxg and zz1<>ming)*zz1;
p1:=(ss1=xx1)*ss1;p2:=(ss1=zz1)*zz1;p3:=(xx1=zz1)*xx1;
pp:=if(p1=0 and p2=0,p3,if(p1,p1,p2));
STICKLINE(zz1=0 and y=1,ss1,xx1,7,1),COLORYELLOW;
STICKLINE(zz1=0 and y=4,ss1,xx1,7,0),COLORBLUE;
STICKLINE(zz1>0 and pp=0,maxg,zxng,7,1),COLORYELLOW;
STICKLINE(zz1>0 and pp=0,ming,zxng,7,0),COLORBLUE;
STICKLINE(zz1>0 and pp and y=1,maxg,ming,7,1),COLORYELLOW;
STICKLINE(zz1>0 and pp and y=4,maxg,ming,7,0),COLORBLUE;
STICKLINE(zz1>0 and pp and (y=1 or (ref(y,1)=1 and y=4)),pp,pp,7,1),COLORYELLOW;
STICKLINE(zz1>0 and pp and (y=4 or (ref(y,1)=4 and y=1)),pp,pp,7,0),COLORBLUE;