if time=closetime(0) and holding>0 then begin
sell(1,0,market);
buyshort(holding=0,1,market);
end
if time=closetime(0) and holding<) then begin
sellshort(1,0,market);
buy(holding=0,1,market);