VARIABLE:x=0,m=0; //多头 hh:=hhv(h,enterbars+1); t1:hh-ENTERPRICE>0.05*enterprice; t2:hh-l>=0.0n*hh; if t1 then x:=1; if x=1 and t2 and holding>0 then begin sell(1,holding,market); x:=0; end //空头 ll:=llv(l,enterbars+1); k1:=enterprice-ll>0.05*enterprice; k2:h-ll>=0.0n*ll; if k1 then m:=1; if m=1 and k2 and holding<0 then begin sellshort(1,holding,market); m:=0; end