DIFIF1:(EMA(CLOSE,12)-EMA(CLOSE,26))*100/EMA(CLOSE,26);
DEAEA1:EMA(DIFIF1,9);
MACD1:=2*(DIFIF1-DEAEA1),STICK;
MACD2:=EMA(MACD1,3);
STICKLINE(MACD1>MACD2ANDMACD1>0,0,MACD1,3,0),COLORRED;
STICKLINE(MACD1>MACD2ANDMACD1<0,0,MACD1,3,0),COLORGREEN;
STICKLINE(MACD1
STICKLINE(MACD1>=0ORMACD1<=0,0,0,50,1),COLORWHITE;
DIFIF1,COLOR33FF33,LINETHICK2;
DEAEA1,COLORYELLOW,LINETHICK2;
MACD:MACD1,NODRAW,COLORMAGENTA;
强:IF(DIFIF1>=DEAEA1,DIFIF1,DRAWNULL),COLORRED,LINETHICK2;
弱:IF(DEAEA1>=DIFIF1,DEAEA1,DRAWNULL),COLORFF9900,LINETHICK2;
DRAWICON(CROSS(DIFIF1,DEAEA1),DIFIF1+0.1,1);
DRAWICON(CROSS(DEAEA1,DIFIF1),0.4,2);
A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));
B1:=REF(C,A1+1)>CANDREF("MACD.DIF",A1+1)<"MACD.DIF"ANDCROSS("MACD.DIF","MACD.DEA");
DRAWTEXT(B1>0,-0.8,'MACD底背'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
B2:=REF(C,A2+1)>CANDREF("KDJ.K",A2+1)<"KDJ.K"ANDCROSS("KDJ.K","KDJ.D");
DRAWTEXT(B2,-0.6,'KDJ底离'),COLORYELLOW;{KDJ底违背};
A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
B3:=REF(C,A3+1)>CANDREF("RSI.RSI1",A3+1)<"RSI.RSI1"ANDCROSS("RSI.RSI1","RSI.RSI2");
DRAWTEXT(B3>0,-0.3,'RSI底离'),COLORCYAN;{RSI底违背};
C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));
D1:=REF(C,C1+1)"MACD.DIF"ANDCROSS("MACD.DEA","MACD.DIF");
DRAWTEXT(D1>0,0.4,'MACD顶离'),COLORBLUE;{MACD顶违背}
C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
D2:=REF(C,C2+1)"KDJ.K"ANDCROSS("KDJ.D","KDJ.K");
DRAWTEXT(D2>0,0.6,'KDJ顶离'),COLORLIMAGENTA;{KDJ顶违背}
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
D3:=REF(C,C3+1)"RSI.RSI1"ANDCROSS("RSI.RSI2","RSI.RSI1");
DRAWTEXT(D3>0,0.8,'RSI顶离'),COLORGREEN;{RSI顶违背};
DD:=C=HHV(C,180);
EE:=DEAEA1<REF(DEAEA1,1)ANDREF(DEAEA1<REF(DEAEA1,1),1)=1;
CC:=C>REF(C,1)ANDREF(C>REF(C,1),1)=1;
上升违背:(CCANDEE)*DEAEA1,COLOR00FFFF;
顶违背:(DDANDEEANDDEAEA1<HHV(DEAEA1,180))*DEAEA1,STICK,LINETHICK3,COLORGREEN;
FF:=C=LLV(C,180);
GG:=DEAEA1>REF(DEAEA1,1)ANDREF(DEAEA1>REF(DEAEA1,1),1)=1;
LL:=C<REF(C,1)ANDREF(C<REF(C,1),1)=1;
下降违背:(LLANDGG)*DEAEA1,COLORMAGENTA;
底违背:(FFANDGGANDDEAEA1>LLV(DEAEA1,180))*DEAEA1,STICK,LINETHICK3,COLORRED;