Stocks rise as trade and earnings optimism lifts Wall Street sentiment