TRR := SUM(MAX(MAX(HIGH-LOW,Abs(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
PDM:= SUM(IF(HD>0 AND HD>LD,HD,0),14);
MDM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);
pdi:= PDM*100/TRR;
mdi:= MDM*100/TRR;
A4:=BArslAST(REF(crOSS(PDI,MDI),1));
B4:=REF(C,A4+1)>C AND REF(PDI,A4+1)