fh:=h;fl:=l;
for p=datacount-1 downto 1 do begin
if fh[p]
if fl[p]>fl[p+1] then
fl[p]:=fl[p+1];
end;
qk:=l>ref(h,1)OR H
G:=IF(l>ref(h,1),L,IF(H
D:=IF(l>ref(h,1),ref(H,1),IF(H
S:=IF(l>ref(h,1),2,IF(H
tj:=s=2 and fL<=G AND fL>=D OR s=1 and fH
w:=BARSSINCE(BACKSET(BARSTATUS=2,BArslAST(TJ*BARPOS=BARPOS)+1))+1;
DD:=DATE;
最近缺口日:REF(DD,W-1)+19000000,LINETHICK0,COLORAAFF33;
S1:=IF(ref(S,W-1)=2,ref(fL,w-1),IF(ref(S,W-1)=1,ref(fH,w-1),0));
S2:=IF(ref(S,W-1)=2,ref(D,w-1),IF(ref(S,W-1)=1,ref(G,w-1),0));
A:=MAX(S1,S2);
B:=MIN(S1,S2);
缺口:B[datacount],COLORWHITE,LINETHICK,,PRECISION2;
→:A[datacount],COLORWHITE,LINETHICK,PRECISION2;
STICKLINE(w,S1,S2,15,0),COLORGRAY;
DRAWTEXT(BARSTATUS=2,A,NUMTOSTR(B,2)+'-'+NUMTOSTR(A,2)),COLOR0099CC,ALIGN2;{显示缺口数字 可删除}
hh:=h;LL:=L;DD:=DATE;
gb:=SYSPARAM(1);
上突缺口:=LOW>REF(HIGH,1),COLOR00EEFF,LINETHICK0;
下突缺口:=HIGH
XQS:=ubound(下突缺口),LINETHICK0;
s1:=SUMBARS(上突缺口,1);
s2:=SUMBARS(上突缺口,2);
x1:=SUMBARS(下突缺口,1);
x2:=SUMBARS(下突缺口,2);
上突位置1:=gb-s1[gb]+1,LINETHICK0;
下突位置1:=gb-x1[gb]+1,LINETHICK0;
DRAWTEXT(下突缺口,h,'△'),COLOREE9933,PXUP15,ALIGN0;
{ _最新股票指标公式}
DRAWTEXT(下突缺口,ref(l,1),'▽'),COLOREE9933,ALIGN0;
DRAWTEXT(上突缺口,l,'▽'),COLOR00EEFF,ALIGN0;
DRAWTEXT(上突缺口,ref(h,1),'△'),COLOR00EEFF,PXUP15,ALIGN0;
XQ1:=LL[下突位置1-1];
XQD:=DD[下突位置1];
BXQ:=COUNT(RANGE(BARPOS,下突位置1,XQS) AND HH>XQ1,XQS-下突位置1)=1;
BXQ:=FILTER(BXQ,XQS-下突位置1);
SQ1:=HH[上突位置1-1];
SQD:=DD[上突位置1];
上缺日:IF(XQD
DRAWTEXT(BSQ,SQ1,'←'),ALIGN0,COLOR00EEEE;
DRAWTEXT(BXQ,(o+c)/2,'
补'+STRRIGHT(NUMTOSTR(XQD,0),6)+'
下突缺口
'+numtostr(XQ1,2)),COLOREEEE66;
DRAWTEXT(BXQ,XQ1,'←'),ALIGN0,COLOR00EEEE;