MTR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),3);
HD:=HIGH-REF(HIGH,1);
LD:=REF(LOW,1)-LOW;
DMP:=EXPMEMA(IF(HD 0 LD,HD,0),3);
DMM:=EXPMEMA(IF(LD 0 HD,LD,0),3);
PDI:=DMP*100/MTR;
MDI:=DMM*100/MTR;
ADX:=EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,2);
ADXR:=EXPMEMA(ADX,2);
TYP:=(HIGH+LOW+CLOSE)/3;
C14:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
DIF:=EMA(CLOSE,6)-EMA(CLOSE,13);
DEA:=EMA(DIF,5);
MACD:=(DIF-DEA)*2;
XG:CROSS(ADX,ADXR) AND C14 REF(C14,1)*1.5 AND PDI REF(PDI,1) AND MACD REF(MACD,1)*2 AND MACD