假设你的开仓手数是SS,开仓最多下5手,那么
限制多头开仓手数就是在开仓条件里面加上 :ss+holding<=5
限制空头开仓手数就是在开仓条件里面加上 :-1*ss+holding>=-5
限制一天的平仓次数用totaldaytrade
限制一天的开仓次数用全局变量,举个例子:你希望一天开仓少于5次
variable:cs:=0;
if 开多条件 and cs<5 and holding=0 then begin
buy........;
cs:=cs+1;
end
if 开空条件 and cs<5 and holding=0 then begin
buyshort........;
cs:=cs+1;
end
最后在代码的结尾处加一句重置全局变量:
if time=closetime(0) then cs:=0;