U.S. stocks closed higher on Thursday after trading in a narrow range as investors digested a rebound in oil prices and looked for more signals on the timing of an interest rate hike.
Energy advanced 1.5 percent to lead the S&P 500 as WTI settled up 37 cents, or 0.73 percent, at $50.79 a barrel, recovering from a 6.6 percent slide on Wednesday. Both Chevron and Exxon Mobil were among the blue chip gainers.
"Oil prices led to the rally (in stocks)," said Peter Cardillo, chief market economist at Rockwell Global Capital.
The closed up 9.19 point or 0.44 percent, at 2,091.09, with energy leading eight sectors higher and utilities lagging.
The Nasdaq closed up 23.74 points, or 0.48 percent, to 4,974.56.
Stocks struggled to find direction for most of Thursday's session as investors geared up for the upcoming earnings season. "The key for the short-term direction lies with the earnings next week," Cardillo said.
On Wednesday after the bell, Alcoa unofficially kicked off the earnings season after reporting adjusted quarterly profit of 28 cents per share, 2 cents above estimates, though revenue was below analyst forecasts. CEO Klaus Kleinfeld said Alcoa's growth compared to a year earlier was due entirely from new businesses. The company's stock closed down more than 3 percent.
The beat on earnings per share but miss on revenue "probably is going to be the theme of earnings season," Cardillo said. "A lot of that is due to the stronger dollar."
Before Thursday's open, Walgreens Boots Alliance reported adjusted quarterly profit of $1.18 per share, beating estimates of 95 cents. Revenue, however, was below Street forecasts. The company revealed plans to close about 200 U.S. stores, and put other streamlining measures into place that will save $1.5 billion annually by the end of 2017.
Constellation Brands reported adjusted quarterly profit of $1.03 per share, 9 cents above estimates, with revenue essentially in line. The company also initiated a quarterly dividend of 31 cents per share. PriceSmart reported after the bell earnings of 82 per share missing Wall Street's expectations of 98 cents.
Consensus expectations for quarterly earnings are low amid a strong dollar and oil's price decline.
In an unusual move, both rose on Thursday. The U.S dollar traded over one percent higher against major world currencies, with the euro lower below $1.07.
Nevertheless, Hogan added that Thursday's rise in the greenback is "much less of a headwind now than when we went from $1.40 to $1.05."
Stocks managed to close higher on Wednesday following the release of minutes from the Federal Open Market Committee's March meeting, which showed policymakers were divided over the timing of a rate hike.
"When you dissect the rest of the statement...you've got a split which on balance (puts) us back to when (Fed Chair) Janet Yellen told us on the 27th it's going to be gradual and data dependent," Hogan said.
"To me the Fed minutes provided some useful information. The conclusion coming out of the Fed statements were significant," said Eric Lascelles, chief economist at RBC Global Asset Management. "I feel like some of that dovish interpretation has faded recently. They're still fairly committed to tightening."
The overall trend in employment data indicates that March's disappointing nonfarm payrolls report was a one-time miss, Hogan said. Jobless claims came in at 281,000, slightly above lowered expectations, but an increase from last week. "We've crossed that Rubicon where bad news are good news."
Peter Boockvar, chief market analyst at The Lindsey group, pointed out in a note that the four-week average on initial jobless claims fell to the lowest level since 2000.
"Bottom line, near 15-year lows in both initial claims and continuing claims is a clear sign that employers are holding on to their employees to a great extent and another sign of a tightening labor market," he said.
The U.S. 10-year Treasury note yield rose to 1.96 percent, a two-week high, following a $13 billion auction of 30-year Treasury bonds. "The 30-year bond auction was weak," Boockvar said. "The 30-year is somewhat of a different animal relative to other parts of the curve in terms of gauging market sentiment because pension funds and insurance companies are big players."
came in slightly higher than expected, up 0.3 percent. However, weak sales provide less incentive for wholesalers to build their inventories.
Costco reported a 2-percent drop in March comparable store sales, a slightly larger decrease than the consensus forecast of a 1.2-percent decline.
Intel has stopped its talks with Altera about a potential acquisition, according to sources familiar with the situation. Kim Forrest, senior equity analyst at Fort Pitt Capital, said that even though she was disappointed the talks fell through, it was "refreshing to see the markets react to specific company news."
Shares of General Electric jumped on news that the company may sell most, if not all, of its real estate holdings, which are worth about $30 billion total.
European equities closed higher on Thursday as investors reacted to fresh economic data and auto stocks posted strong gains.
Concern about Greece abated with the country raising enough funds to meet a payment to the International Monetary Fund due Thursday.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, traded near 13.
Decliners closed the session a touch ahead of advancers on the New York Stock Exchange, with an exchange volume of 725.20 million and a composite volume of 3.15 billion.
Gold futures settled $8.80 lower at $1,194.30 an ounce.
—CNBC's Peter Schacknow contributed to this report.
On tap this week:
8:30 a.m.: Import prices
8:45 a.m.: Richmond Fed President Jeffrey Lacker on economic outlook
12:20 p.m.: Minneapolis Fed's Kocherlakota
2:00 p.m.: Federal budget