Investing.com - The S&P 500 closed higher, but shy of all-time highs, Tuesday buoyed by a rally in energy and strong earnings reports.
The Dow Jones Industrial Average rose about 0.50%. The S&P 500 rose 0.29%, while the Nasdaq Composite rose about 0.31%. The S&P 500 closed just of its all-time closing high of 2,872.87.
Strong corporate earnings stoked investor appetite for riskier assets, casting aside trade-war concerns and paving the way for the broader market to extend gains.
Twilio (NYSE:TWLO) stock closed about 19% higher as the company said a day earlier that both revenue and earnings topped Wall Street estimates.
Energen (NYSE:EGN) also delivered above-consensus earnings, while Mosaic (NYSE:MOS) earnings came in above estimates, but revenue fell just short.
Zillow Group (NASDAQ:ZG) stock tanked more than 16%, meanwhile, after the company reported below-consensus earnings and announced the acquisition of a mortgage lender.
A string of mostly bullish corporate earnings in the second quarter has helped divert investor attention away from the U.S. and China trade war that so far has shown no signs of abating amid weeks of stalled negotiations.
About 80% S&P 500 companies delivered earnings reports that beat Wall Street estimates, FactSet reported.
Investor appetite for stocks has also been bolstered by expectations that share buybacks will rise 46% to $1 trillion in 2018 compared to last year as extra cash from tax reform and strong corporate cash flows are returned to shareholders, according to Goldman Sachs (NYSE:GS).
Rising energy stocks ensured the broader market added to gains as oil prices settled higher after the United States re-imposed sanctions against Iran, fueling global supply concerns.
On the New York Mercantile Exchange crude futures for September rose 16 cents to settle at $69.17 a barrel.
In corporate news, Tesla (NASDAQ:TSLA) stock surged following a tweet and later statement from CEO Elon Musk that he was considering taking the company private.
Musk confirmed in a blog post that he wants to take the company private, but stressed that a final decision had not been made.
Wild swings in Tesla's share prices can be major distraction for everyone at Tesla, and the need for quarterly reports pressures the company to make decision for the quarter that may not necessarily be in the long-term interest of the company, Musk said in support of his decision to consider taking the company private.
In economic news, U.S. job openings undershot economists' estimates, but that drew muted reaction in markets as job openings remained near record highs in June.
Snap Inc (NYSE:SNAP) rallied in after-hours trade as investors cheered the company's second-quarter top and bottom line beat, shrugging off lower than expected daily average user growth.
Snap reported a loss of 14 cents per share on revenues of $262 million that beat analysts expectations for a loss of 17 cents a share on revenues of $250.4 million. While daily active users rose to 188 million for the quarter, below the 192 million analysts had expected.
Top S&P 500 Gainers and Losers Today:
Broadridge Financial Solutions (NYSE:BR), Mosaic Company (NYSE:MOS) and Emerson Electric (NYSE:EMR) were among the top S&P 500 gainers for the session.
Dentsply Sirona (NASDAQ:XRAY), Expeditors International Washington (NASDAQ:EXPD) and Anadarko Petroleum (NYSE:APC) , were among the worst S&P 500 performers of the session.