{趋势线【新方法】}
input:n(16),m(0); drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4; z:=zig(4,n); p:=SYSPARAM(1); dd:="xh-z.dd"(n); wd:=barslast(dd); sd:=sum(dd,0); di:=sd[p]-sd+1; id:=(di<ref(di,1))*di; gg:="xh-z.gg"(n); wg:=barslast(gg); sg:=sum(gg,0); gi:=sg[p]-sg+1; ig:=(gi<ref(gi,1))*gi; td0:=barslast(di[p]=id); td1:=barslast(1+di[p]=id); td2:=barslast(2+di[p]=id); x:ref(z,td0),POINTDOT; k1:(x-ref(z,td1))/ref(td1,td0)*100,LINETHICK0,COLORGREEN; k3:(ref(z,td1)-ref(z,td2))/ref(td2,td1)*100,LINETHICK0,Color5E7159; x1:x+td0*k1/100,LINETHICK0,COLORGREEN; x2:ref(z,td1)+td1*k3/100,LINETHICK0,Color5E7159; DRAWLINE(1+di[p]=id,z,di[p]=id,z,1),COLORGREEN; DRAWLINE(2+di[p]=id,z,1+di[p]=id,z,1),Color5E7159,POINTDOT; tg0:=barslast(gi[p]=ig); tg1:=barslast(1+gi[p]=ig); tg2:=barslast(2+gi[p]=ig); s:ref(z,tg0),POINTDOT; k2:(s-ref(z,tg1))/ref(tg1,tg0)*100,LINETHICK0,COLORMAGENTA; k4:(ref(z,tg1)-ref(z,tg2))/ref(tg2,tg1)*100,LINETHICK0,Color546C82; s1:s+tg0*k2/100,LINETHICK0,COLORMAGENTA; s2:ref(z,tg1)+tg1*k4/100,LINETHICK0,Color546C82; DRAWLINE(1+gi[p]=ig,z,gi[p]=ig,z,1),COLORMAGENTA; DRAWLINE(2+gi[p]=ig,z,1+gi[p]=ig,z,1),Color546C82,POINTDOT; DRAWICON((dd and di<5) or (gg and gi<5),z,12); DRAWICON(di[p]=id or gi[p]=ig,z,10); {点击看本软件截图: 58股票 公式网 http://www. 58gu. com 整理} |