TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),6);HD := HIGH-REF(HIGH,1);LD := REF(LOW,1)-LOW;DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),6);DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),6);PDI:= DMP*100/TR;MDI:= DMM*100/TR;ADX: MA(ABS(MDI-PDI)/(MDI+PDI)*100,14),LINETHICK0;ADXR:(ADX+REF(ADX,14))/2,LINETHICK0;TJ:CROSS(ADXR,ADX) AND ADX>50 AND REF(BARSLAST(CROSS(ADXR,ADX)),1)<20 AND REF(ADX,REF(BARSLAST(CROSS(ADXR,ADX)),1)+1)>50 ;
TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),6);HD := HIGH-REF(HIGH,1);LD := REF(LOW,1)-LOW;DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),6);DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),6);PDI:= DMP*100/TR;MDI:= DMM*100/TR;ADX: MA(ABS(MDI-PDI)/(MDI+PDI)*100,14),LINETHICK0;ADXR:(ADX+REF(ADX,14))/2,LINETHICK0;TJ:CROSS(ADXR,ADX) AND ADX>50 AND REF(BARSLAST(CROSS(ADXR,ADX)),1)<20 AND REF(ADX,REF(BARSLAST(CROSS(ADXR,ADX)),1)+1)>50 ;