DIF1:EMA(C,84)-EMA(CLOSE,180)COLORLIGRAY,LINETHICK1;
DEA1:EMA(DIF1,6)COLORLIRED,LINETHICK1;
MACDF:(DIF1-DEA1)*2,COLORSTICK;
{DRAWBAND(DEA1,RGB(0,224,24),DIF1,RGB(185,196,0));}
PJ:3*DIF1-2*DEA1,COLORLIBLUE;
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG)COLORYELLOW,LINETHICK2;
DEA:EMA(DIF,MID)COLORWHITE,LINETHICK2;
MACD:=(DIF-DEA)*2,COLORSTICK;
J:3*DIF-2*DEA,COLORLIGREEN,LINETHICK2;
K9:=BACKSET(J>REF(J,1),2);
IF(K9,J,DRAWNULL),COLORRED,LINETHICK2;
K8:=BACKSET(PJ>REF(PJ,1),2);
IF(K8,PJ,DRAWNULL),COLORMAGENTA,LINETHICK2;
{K8:=BACKSET(PJ>REF(PJ,1),2);
IF(K8,PJ,DRAWNULL),COLORMAGENTA,LINETHICK2;}
STICKLINE(MACD>0 AND MACD>REF(MACD,1),0,MACD,0.8,0),COLORRED;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,0.8,0),COLORYELLOW;
STICKLINE(MACD<0 AND MACD>REF(MACD,1),0,MACD,0.8,0),COLORLIRED;
STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,0.8,0),COLORLIBLUE;
A1:=BARSLAST(REF(CROSS(DIF1,DEA1),1));
背离:=REF(CLOSE,A1+1)>CLOSE AND DIF1>REF(DIF1,A1+1) AND CROSS(DIF1,DEA1);
STICKLINE(背离,DIF1,0.05,2,0),COLORWHITE;
DRAWTEXT(背离,DIF1-0.01,'背离'),COLORCYAN;
|