if 條件 then value1 = C;
if C < value1 and value1 <> 0 then begin
buy .....
value1 = 0;
end;
要判斷量的話,把 C 改成 ticks 就可以