if h>ref(hhv(h,3),1) then begin
sellshort(1,0,marketr);
buy(holding=0,1,marketr);
end
if l<ref(llv(l,3),1) then begin
sell(1,0,marketr);
buyshort(holding=0,1,marketr);
end
if holding>0 and l<enterprice-5 then sell(1,0,marketr);
if holding<0 and h>enterprice+5 then sellshort(1,0,marketr);