DIF:=Ema(CLOSE,12)-EMA(CLOSE,26),COLORRED;
DEA:=EMA(DIF,9),COLORBLUE;
macd:=2*(DIF-DEA);
TR1:=SUM(MAX(MAX((HIGH-LOW),Abs((HIGH-REF(CLOSE,
1)))),ABS((LOW-REF(CLOSE,1)))),10);
HD:=(HIGH-REF(HIGH,1));
FH1:=REF(MacD,1)<REF(MACD,2) AND REF(MACD,
2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4);
FH2:=MACD>=0 AND COUNT(MACD>REF(MACD,1),1)=1;
LD:=(REF(LOW,1)-LOW);
DMP:=SUM(IF(((HD>0) AND (HD>LD)),HD,0),10);
DMM:=SUM(IF(((LD>0) AND (LD>HD)),LD,0),10);
FH3:=FH1 AND FH2 AND EMA(C,13)>REF(EMA(C,13),1);
FH4:=FH1 AND FH2 AND ABS((DIF-DEA)/C)<0.018;
FH5:=FH1 AND FH2 AND MACD<0.10;
二次翻红:=(FH3 OR FH4 OR FH5);
翻红:二次翻红;