在交易系统中使用,单独使用没有用
你要的是当前是连亏几次了
而这个函数记录的是之前有几次连亏
比如
亏亏赢 那么就是有1次连亏
亏亏赢亏亏赢 那么就是有2次连亏
variable:n=0;
if 平多条件 and holding>0 then begin
sell(1,0,thisclose);
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,thisclose);
if numprofit(1)>0 then n:=0;
if numprofit(1)<0 then n:=n+1;
end
n就是当前的连亏次数