VAR1:=AMOUNT/10000;VAR2:=IF(VOL-REF(VOL,1)<0,VOL,0);VAR3:=SUM((CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*VAR2/1000,0);VAR3<REF(VAR3,1) AND REF(VAR3,1)<REF(VAR3,2) AND REF(VAR3,2)<REF(VAR3,3);