那么计算的方式要复杂一些,以开多仓为例
variable:liankui=0;
nn:=barslast(平多条件 and holding>0)+1;
if ref(openprofit,nn)<0 and 平多条件 and holding>0 and openprofit<0 then begin
平多语句;
n:=n+1;
end
if 平多条件 and holding>0 and openprofit>0 then begin
平多语句;
n:=0;
end
然后在反手条件里面加上N<3