n 20
APP:=vol/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
ASUPLY:=IF(CLOSE>OPEN,APP*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,APP*(HIGH-LOW),VOL/2));
ADEMAND:=IF(CLOSE>OPEN,APP*(HIGH-LOW),IF(CLOSE<OPEN,APP*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2));
RDEMAND:=IF(CLOSE>OPEN,APP*(CLOSE-OPEN),0);
RSUPLY:=IF(CLOSE<OPEN,APP*(OPEN-CLOSE),0);
RSDC:SUM(RDEMAND,n)/(SUM(RSUPLY,n)+SUM(RDEMAND,n))*100;
ASDC:SUM(ADEMAND,20)/(SUM(ASUPLY,20)+SUM(ADEMAND,20))*100;