//多头 VARIABLE:n=0,m=0; hh:hhv(h,enterbars+1); if hh-enterprice>=0.5*enterprice then n:=1; if n=1 and hh-l>=382 and holding>0 then begin sell(1,holding,market); n:=0; end //空头 ll:llv(l,enterbars+1); if enterprice-ll>=0.5*enterprice then m:=1; if m=1 and h-ll>=382 and holding<0 then BEGIN sellshort(1,1,market); m:=0; end