variable:n=0,m=0;
if 平多条件 and holding>0 then begin
sell(1,0,market);
if numprofit(1)>0 and numprofit(2)>0 then n:=n+1;
if numprofit(1)<0 and numprofit(2)<0 then m:=m+1;
if numprofit(1)>=0 and numprofit(2)<=0 then n:=1;
if numprofit(1)<=0 and numprofit(2)>=0 then m:=1;
end
if 平空条件 and holding>0 then begin
sellshort(1,0,market);
if numprofit(1)>0 and numprofit(2)>0 then n:=n+1;
if numprofit(1)<0 and numprofit(2)<0 then m:=m+1;
if numprofit(1)>=0 and numprofit(2)<=0 then n:=1;
if numprofit(1)<=0 and numprofit(2)>=0 then m:=1;
end
n是连赢次数,m是连亏次数