这个要做全局变量
variable:n=0;
if n=0 and 开多条件 and 持仓判断 then begin
buy(1,1,market);
N:=1;
end
if n=1 and 开多条件 and 持仓判断 and typebar(1,1)>5 then begin
buy(1,1,market);
n:=2;
end
if time=closetime(0) then n:=0;
一般就这样写。n用来记录下单次数。用户只需要把自己的开多条件和持仓判断条件带入进去就行
开空一样的写法,typebar要写成typebar(1,3)>5