nn:=barssince(开仓条件);
hh:hhv(h,nn+1);
variable:cishu=0;
if 平多条件 and 持仓判断 then begin
sell(1,0,market);
if numprofit(1)>0 then cishu:=cishu+1;
end
if 平空条件 and 持仓判断 then begin
sellshort(1,0,market);
if numprofit(1)>0 then cishu:=cishu+1;
end
if cishu=n then cishu:=0;
nn:=barslast(cishu=1 and ref(cishu=0,1))
hh:hhv(h,nn+1);
哦,明白了,原来也可以对variable这样的变量做ref回朔,多谢!