Stocks reversed course from their lows Monday and closed higher across the board after Trump gave signs that an end may be in sight for the U.S.-Iran war.