variable:n=0;
if 平多条件 and holding>0 then begin
sell(1,0,market);
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,market);
if numprofit(1)>0 then n:=0;
if numprofit(1)<=0 then n:=n+1;
end
if n=5 and ref(n,1)=4 then ss:=ss*2;
感谢提交建议!