需要通过全局变量来控制,比如:variable:cs=0;//定义全局变量开仓次数为cs
if 开仓条件 and cs<=1 then
begin
buy(1,1,market);
cs=cs+1;
end
if time=closetime(0) then cs:=0;//收盘重置开仓次数
可以用全局变量限定下。
variable:mark=1;
if buycond and mark then
begin
buy(1,1,market);
mark:=0;
end
if time =closetime(0) then mark:=1;//收盘时重置下mark变量