variable:n=0;
if 平多条件 and holding>0 then begin
sell(1,0,marketr);
if numprofit(1)>0 then n:=0;
if numprofit(1)<0 then n:=n+1;
end
if 平空条件 and holding<0 then begin
sellshort(1,0,marketr);
if numprofit(1)>0 then n:=0;
if numprofit(1)<0 then n:=n+1;
end
最大连亏次数:hhv(n,0);