variable:n=0;
if date<>ref(date,1) then n:=0;
if n=0 and 下单条件 then buy(holding=0,1,market);
if holding>0 and 平仓条件 then begin
sell(holding>0,0,market);
if c-enterprice>20*mindiff then
n:=1;
end
if holding>0 and 平仓条件 then begin
sell(holding>0,0,market);
if enterprice-c>10*mindiff then
n:=1;
end