if holding>0 and hhv(h,enterbars+1)>enterprice+10*mindiff and (h-enterprice)<=(hhv(h,enterbars+1)-enterprice)*0.5 then sell(1,0,makret);
if holding<0 and llv(l,enterbars+1)<enterprice+10*mindiff and (enterprice-l)<=(enterprice-llv(h,enterbars+1))*0.5 then sellshort(1,0,market);