DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
AA:=CROSS(DIF,DEA);
BB:=BARSLAST(AA);
CC:=REF(BB,1)+1;
DD:=C<REF(C,CC) AND DIF>REF(DIF,CC) AND AA;
DRAWICON(DD,DIF,1);
DRAWTEXT(DD,DIF-0.1,'底背离'),COLORRED;
EE:=NOT(DD) AND AA;
STICKLINE(EE,DIF,DIF+0.1,0,0),COLORMAGENTA;
DRAWTEXT(EE,DIF+0.1,'金叉'),COLORMAGENTA;
AA1:=CROSS(DEA,DIF);
BB1:=BARSLAST(AA1);
CC1:=REF(BB1,1)+1;
DD1:=C>REF(C,CC1) AND DIF<REF(DIF,CC1) AND AA1;
DRAWICON(DD1,DIF,2);
DRAWTEXT(DD1,DIF+0.1,'顶背离'),COLORLIBLUE;
EE1:=NOT(DD1) AND AA1;
STICKLINE(EE1,DIF,DIF+0.1,0,0),COLORBLUE;
DRAWTEXT(EE1,DIF+0.1,'死叉'),COLORBLUE;
|