{凹口第二红波}
N:=14;M:=6; MN:=12;
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
AA:=RANGE(REF(MACD,2),REF(MACD,1),REF(MACD,3))
AND REF(MACD,1)<MACD
AND RANGE(REF(MACD,1),0,0.15) AND MACD>0.05;
TR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N);
HD :=HIGH-REF(HIGH,1);
LD :=REF(LOW,1)-LOW;
DMP:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),N);
DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),N);
PDI:= DMP*100/TR;
MDI:= DMM*100/TR;
ADX:= EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,M);
ADXR:=EXPMEMA(ADX,M);
BB:=ADX>30 AND ADX>ADXR AND MDI>MN;
AA AND BB; |