网友求助:

{MACD新}
QD:=VOL/DYNAINFO(51)/10;
QD5:=EMA(QD,3);
DIFF:EMA(QD,5)-EMA(QD,7);
DEA:EMA(DIFF,5);
MACD:2*(DIFF-DEA),COLORSTICK;
金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
JC:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JC=2,21)=1;
DRAWICON(二次,DEA*0.9,1) ;
DRAWTEXT(二次,-0.2,' 二次金叉'),COLORYELLOW;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA),LINETHICK0;
DRAWTEXT(底背离,-0.5,' 底背离'),COLORMAGENTA;

FILLRGN(dea<diff,diff,dea),colorred;
FILLRGN(dea>diff,diff,dea),COLORGREEN;

变化率:(MACD/REF(MACD,1)-1),LINETHICK0;
乖离:(DIFF-DEA)/DEA*100,LINETHICK0,COLORRED;
比值:DIFF/DEA,LINETHICK0,COLORWHITE;

 

 

解答如下:

0;
QD:=VOL/DYNAINFO(51)/10;
QD5:=EMA(QD,3);
DIFF:EMA(QD,5)-EMA(QD,7);
DEA:EMA(DIFF,5);
MACD:2*(DIFF-DEA),COLORSTICK,LINETHICK3;
金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
JC:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JC=2,21)=1;
DRAWICON(二次,DEA*0.9,1) ;
DRAWTEXT(二次,-0.2,' 二次金叉'),COLORYELLOW;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
DRAWTEXT(底背离,-0.5,' 底背离'),COLORMAGENTA;
FILLRGN(diff,dea,dea<diff),colorred,LAYER7;
FILLRGN(diff,dea,dea>diff),COLORGREEN,LAYER7;
变化率:(MACD/REF(MACD,1)-1),LINETHICK0;
乖离:(DIFF-DEA)/DEA*100,LINETHICK0,COLORRED;
比值:DIFF/DEA,LINETHICK0,COLORWHITE;