US stocks close with gains on possible easing trade tensions