平多止损1:=AVGENTERPRICE-c>=10;
variable:n=0;
hh:=hhv(h,enterbars+1);//开仓后最高价
nn:=hh-enterprice;//开仓后盈利最高点
nn1:=h-enterprice;//当前盈利点数
if nn1>10*mindiff and nn1<=0.5*nn and enterbars>0 and n=0 then begin
sell(holding>0,0,market);//止损语句
n:=1;
end
if time=closetime(0) then n:=0;