N1:=14;N:=14;M:=5;
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
macd:=2*(DIFF-DEA);
低位金叉:=crOSS(DIFF,DEA) AND DIFF<-5;
TYP:=(HIGH+LOW+CLOSE)/3;
cci:=(TYP-MA(TYP,N1))/(0.015*AVEDEV(TYP,N1));
TR1:=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/TR1;
mdi:=DMM*100/TR1;
ADX:=EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,M);
ADXR:=EXPMEMA(ADX,M);
XG:EXIST(CCI<-200,5) AND EXIST(ADX>55,5);