AA:=HHV(CLOSE,130)*0.9,COLORYELLOW,LINETHICK2;
牛熊线:=MA(((SLOPE(C,20)*5)+C),10),COLORRED;
N:=14;M:=6;
MTR:=SUM(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:=SUM(IF(HD>0&&HD>LD,HD,0),N);
DMM:=SUM(IF(LD>0&&LD>HD,LD,0),N);
pdi:=DMP*100/MTR,COLORRED;
mdi:=DMM*100/MTR;
ADX:=MA(ABS(MDI-PDI)/(MDI+PDI)*100,M);
ADXR:=(ADX+REF(ADX,M))/2;
XG:crOSS(牛熊线,AA) AND PDI>MDI AND (ADX>REF(ADX,1) AND ADX>ADXR) AND C>AA AND C<50;