DIFF:EMA(CLOSE,12)-EMA(CLOSE,27);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK2;
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
DRAWICON(低位金叉,DEA*0.9,1) ;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
DRAWICON(二次金叉,DEA*0.9,5) ;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背離:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND
CROSS(DIFF,DEA);
底背:DRAWLINE(A1=0,DEA,底背離,DEA,0),COLORRED,LINETHICK4;
DRAWTEXT(底背離,-1,' 底背'),COLORRED;
DRAWICON(CROSS(DEA,DIFF),DIFF,2);
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
頂背離:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND
CROSS(DEA,DIFF);
頂背:DRAWLINE(A2=0,DEA,頂背離,DEA,0),COLORGREEN,LINETHICK4;
DRAWTEXT(頂背離,1,' 頂背'),COLORGREEN;
三全項:=(低位金叉 AND 二次金叉 AND 底背離);
STICKLINE(三全項,0,0.8,1,0),COLORYELLOW,LINETHICK2;
DRAWTEXT(低位金叉 AND 二次金叉 AND 底背離,1,'三全項'),COLORYELLOW;
MACD值:2*(DIFF-DEA),COLORSTICK,COLORRED;
VAR8:=SUM(MACD值,0);
VAR9:=IF(MAX(VAR8,REF(VAR8,2))<REF(VAR8,1) OR MIN(VAR8,REF(VAR8,2))>REF(VAR8,1),1,0);
VAR10:=BARSLAST(VAR9)+1;
VAR11:=VAR8-REF(VAR8,VAR10);
VAR12:=IF(MACD值>0,HHV(ABS(MACD值),VAR10),LLV(MACD值,VAR10));
VAR13:=MACD值/20;
紅面積:SUM(MACD,BARSLAST(MACD<0))*(MACD>0),COLOR0000FF,NODRAW;
綠面積:SUM(MACD,BARSLAST(MACD>0))*(MACD<0),COLORFFFF00,NODRAW;
AA:=ROUND(REF(綠面積,1)*100);BB:=ROUND(REF(紅面積,1)*100);
DRAWNUMBER(CROSS(0,MACD),HHV(REF(MACD,1),5)+0.03,ABS(BB)),COLORMAGENTA;
DRAWNUMBER(CROSS(MACD,0),LLV(REF(MACD,1),5)-0.03,ABS(AA)),COLORGREEN;
聯(lián)系客服