variable:n=0;
if date<>ref(date,1) then n:=0;
if n=0 and 持仓判断 and 开多条件 then begin
buy.........;
n:=1;
end
if n=0 and 持仓判断 and 开空条件 then begin
buyshort........;
n:=1;
end
variable:m=0,n=0;
if date<>ref(date,1) then begin
m:=0;
n:=0;
end
if m=0 and 持仓判断 and 开多条件 then begin
buy.........;
m:=1;
end
if n=0 and 持仓判断 and 开空条件 then begin
buyshort........;
n:=1;
end