以下是通达信小顶底背离源码附图
{小周期}
N:=3;
DIF3_6.5F:=(EMA(CLOSE,3)-(EMA(CLOSE,6)+EMA(CLOSE,7))/2);
DEA3_6.5F:=(EMA(DIF3_6.5F,3)+EMA(DIF3_6.5,2));
AA:=REF(DIF3_6.5F,N)=HHV(DIF3_6.5F,2*N+1);
CC:=FILTER(BB,N) AND DIF3_6.5F=HHV(DIF3_6.5F,N+1);
AX1:=BARSLAST(REF(CC,1));
小顶背离:=REF(CLOSE,AX1+1)<CLOSE AND REF(DIF3_6.5F,AX1+1)>DIF3_6.5F AND CC;
DRAWTEXT(小顶背离,DIF3_6.5F*1.2,'-小顶背离'),COLORGREEN;
DRAWICON(小顶背离>0,DIF3_6.5F*1.2,2);
AAA2:=REF(DIF3_6.5F,N)=LLV(DIF3_6.5F,2*N+1);
BBB2:=BACKSET(AAA2,N+1);
CCC2:=FILTER(BBB2,N) AND DIF3_6.5F=LLV(DIF3_6.5F,N+1);
AX2:=BARSLAST(REF(CCC2,1));
小底背离:=REF(CLOSE,AX2+1)>CLOSE AND REF(DIF3_6.5F,AX2+1)<DIF3_6.5F;