以下是通达信上升(下降)通道画线

上下通道,比较直观点

INPUT:N(240,0,999);
hh:=hhv(h,N);
hhh:=h;
aa:=BARSLAST(h=hh[datacount]);
ba:datacount-aa,LINETHICK0;
ja:=1;
tm1:=999999;
for i1=ba[datacount]+1 to datacount do begin
k1:=(hh[datacount]-hhh[i1])/ja;
if k1<tm1 then begin
tm1:=k1;
ts1:=ja;
end;
ja:=ja+1;
end;
A1:LINEVALUE(h=hh[datacount] and aa=0,h,BARPOS=datacount-aa[datacount]+ts1,h,0,0),colorffff54;
cha:=hhv(abs(l-a1),aa);
A2:a1-cha[datacount],colorffff54;
AI:a1-cha[datacount]/2,colorffff54,LINEDASH;
ll:=llv(l,N);
lll:=l;
a3:=BARSLAST(l=ll[datacount]);
b3:=datacount-a3;
j3:=1;
tm3:=999999;
for i3=b3[datacount]+1 to datacount do begin
k3:=(lll[i3]-ll[datacount])/j3;
if k3<tm3 then begin
tm3:=k3;
ts3:=j3;
end;
j3:=j3+1;
end;
B1:LINEVALUE(l=ll[datacount] and a3=0,l,BARPOS=datacount-a3[datacount]+ts3,l,0,0),color5454ff;
chb:=hhv(abs(h-b1),a3);
b2:b1+chb[datacount],color5454ff;
bi:b1+chb[datacount]/2,color5454ff,LINEDASH;

 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。