(来源:文华财经)
COND1:=H>REF(H,1)&&L>=REF(L,1);
COND2:=H<=REF(H,1)&&L<REF(L,1);
A1:=H<=REF(H,1)&&L>=REF(L,1);
A2:=H>REF(H,1)&&L<REF(L,1);
N1:=BARSLAST(CROSS(COND1,0.5))+1;
N2:=BARSLAST(CROSS(COND2,0.5))+1;
AA:BARSLASTCOUNT(N1<N2&&(A1||A2||COND1))=1,NODRAW;
BB:BARSLASTCOUNT(N1>N2&&(A1||A2||COND2))=1,NODRAW;
DRAWNUMBER(N1<N2&&(A1||A2||COND1),H,BARSLASTCOUNT(N1<N2&&(A1||A2||COND1)),0,COLORYELLOW);//显示全部序列数字
DRAWNUMBER(N1>N2&&(A1||A2||COND2),H,BARSLASTCOUNT(N1>N2&&(A1||A2||COND2)),0,COLORCYAN);
AAX:=BACKSET(ISLASTBAR,1+MAX(BARSLAST(BARSLASTCOUNT(N1>N2&&(A1||A2||COND2))=1),BARSLAST(BARSLASTCOUNT(N1<N2&&(A1||A2||COND1))=1)));
DD:N1<N2&&(A1||A2||COND1),NODRAW;
KK:N1>N2&&(A1||A2||COND2),NODRAW;
DDD:=CROSS(BACKSET(ISLASTBAR&&KK,BARSLASTCOUNT(KK)+1)=1,0.5),ICON(1,'ICO1');
KKK:=CROSS(BACKSET(ISLASTBAR&&DD,BARSLASTCOUNT(DD)+1)=1,0.5),ICON(0,'ICO1'),VALIGN0;
HH:=IF(VALUEWHEN(CROSS(DD=1,0.5),H)=HHV(H,BARSLASTCOUNT(DD)),BARSLASTCOUNT(DD),BARSLAST(H>HV(H,BARSLASTCOUNT(DD)-1))+1);
LL:=IF(VALUEWHEN(CROSS(KK=1,0.5),L)=LLV(L,BARSLASTCOUNT(KK)),BARSLASTCOUNT(KK),BARSLAST(L<LV(L,BARSLASTCOUNT(KK)-1))+1);
HHL:=CROSS(BACKSET( CROSS(BACKSET(CROSS(BACKSET(DDD,HH),0.5),NEWLBARS(L,1)+1)=1,0.5),NEWLBARS(L,1)+1)=1,0.5);
LLH:=CROSS(BACKSET( CROSS(BACKSET(CROSS(BACKSET(KKK,LL),0.5),NEWHBARS(H,1)+1)=1,0.5),NEWHBARS(H,1)+1)=1,0.5);
DRAWSL(HHL,L,0,1000,0,COLORYELLOW);
DRAWICON(HHL,L,4),VALIGN0;
DRAWSL(LLH,H,0,1000,0,COLORCYAN);
DRAWICON(LLH,H,5),VALIGN2;
CROSS(BACKSET(DDD,HH),0.5),ICON(1,'ICO1');//高点图标
CROSS(BACKSET(KKK,LL),0.5),ICON(0,'ICO2'),VALIGN0;//低点图标
DRAWSL(CROSS(BACKSET(DDD,HH),0.5),H,0,100,0,COLORRED),DOT;