指定周期范围内最近一次未补上下缺口和价咯【源码】 //缺口 input:缺(240); //默认240日内,设为0则全部 s:=l>ref(h,1);x:=h<ref(l,1);l1:=l;h1:=h;swz:=0;xwz:=0;dt:=datacount;l2:=l;h2:=h; for i=dt downto max(lbound(s)+1,dt-if(缺=0,dt,缺)) do begin if s[i] then begin for m=i to dt do begin if h1[i-1]>l1[m] then break; end; if m>dt then begin swz:=i; break; end; end; end; for i=dt downto max(lbound(x)+1,dt-if(缺=0,dt,缺)) do begin if x[i] then begin for m=i to dt do begin if l1[i-1]<h1[m] then break; end; if m>dt then begin xwz:=i; break; end; end; end; t:=sort(l2,1,swz,dt);t:=sort(h2,0,xwz,dt); if xwz>0 then FILLRGN(barpos>=xwz-1,l1[xwz-1],h2[dt]),COLOR888888; if swz>0 then FILLRGN(barpos>=swz-1,h1[swz-1],l2[dt]),COLOR888888; if xwz>0 then drawtext(dt-barpos=5,(l1[xwz-1]+h2[dt])/2,NUMTOSTR(l1[xwz-1], 2)+'--'+NUMTOSTR(h2[dt], 2)),coloryellow; if swz>0 then drawtext(dt-barpos=5,(h1[swz-1]+l2[dt])/2,NUMTOSTR(h1[swz-1], 2)+'--'+NUMTOSTR(l2[dt], 2)),colorwhite; //缺口 |
