US stocks end trading day with losses