IT comes down to what's in the manufacturer's installation manual. if you don't have yours, you may find it online at the manufacturer's website. Code essentially says installed per the manufacturer's instructions. I've seen some that want it to slope out, and some that require it to not slope out (i.e, back to the tank). If you have enough room for the about 4" of drop on the pipe over that distance, nothing says you can't go up a bit more directly out of the top of the tank.