variable:n=0;
if 平空条件 and holding<0 and n=0 then begin
sellshort.......;
if numprofit(1)<=x then n:=1;
end
if 平多条件 and holding>0 and n=0 then begin
sell....;
if numprofit(1)<=x then n:=1;
end
if closetime(0)=time then n:=0;
框架大体如此,只需在开仓条件加入n=0即可
差不多的,修改一下就行
variable:n=0;
if 平空条件 and holding<0 and totaldaytrade=0 and openprofit<=x then begin
sellshort.......;
n:=1
end
if 平多条件 and holding>0 and totaldaytrade=0 and openprofit<=x then begin
sell....;
n:=1;
end
if closetime(0)=time then n:=0;
然后开仓条件加入n=0