源码
LONG:=24;SHORT:=13;M:=6;
DIF:EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA:EMA(DIF,M),COLOR85B559;
MACD:2*(DIF-DEA),COLORSTICK;
MACD2:2*(DEA-DIF),COLORFF9933;
A4:=BARSLAST(REF(CROSS(DIF,DEA),1));
B1:=REF(C,A4+1)>C AND REF(DIF,A4+1)
操盘:STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLORRED{COLOR6058FF};
减仓:STICKLINE(MACD>=0 AND MACD< REF(MACD,1),0,MACD,1,0),COLORBLUE{COLOR6058FF};
反弹:STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLORYELLOW{COLORFFFF00};
寻底:STICKLINE(MACD<0 AND MACD< REF(MACD,1),0,MACD,1,0),COLORFFFF00;
空仓:0,COLOR0099FF;
IF(DIF<0,DIF,0),COLORYELLOW,LINETHICK2;
IF(DIF<0,0,DIF),COLORRED,LINETHICK2;
IF(DIF
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
周K:=MA("KDJ.K#WEEK"(9,3,3) ,5);
周D:=MA("KDJ.D#WEEK"(9,3,3) ,5);
周J:=MA("KDJ.J#WEEK"(9,3,3) ,5);
周金:DRAWTEXT(CROSS("KDJ.K#WEEK"(9,3,3),"KDJ.D#WEEK"(9,3,3)) ,MACD,'▲'),COLORRED;
周死:DRAWTEXT(CROSS("KDJ.D#WEEK"(9,3,3),"KDJ.K#WEEK"(9,3,3)) ,MACD*1.5,'▼'),COLORFFFF00;