U.S. stocks closed mildly higher Tuesday, amid declines in oil prices, as investors eyed the latest Brexit polls and digested remarks from the Fed chair. All three major indexes briefly erased opening gains in mid-morning trade.
"I think that you've got a polling stalemate and people don't know what to do," said Maris Ogg, president at Tower Bridge Advisors. "At this moment, I think it's better to stay in cash."
Tech was one of the leaders in the S&P 500, helped by gains of 3 percent in shares of Micron Technology. Microsoft also gained more than 2 percent higher. The benchmark index outperformed, gaining about 0.3 percent.
The Nasdaq composite underperformed, with the iShares Nasdaq Biotechnology ETF (IBB) trading more than 1 percent lower. The Dow transports and Russell 2000 fell about a third of a percent lower or more.
The EU referendum is set for Thursday. Analysts at Citi said in a Tuesday note they still see a 40 percent probability of a Brexit. "The end of the referendum will not alleviate political fragmentation, with anti-immigration, anti-establishment sentiment contributing to Vox Populi Risk, especially but not exclusively in Europe," they said.
"The focus of attention this week is on the U.K. vote on Thursday. It looks like overnight the polls tightened up a little bit," said Bruce Bittles, chief investment strategist at Baird. "It's a pretty nervous market. Nobody has any profits for the year. The last thing you want to do is get caught in a downdraft."
Ahead of the referendum, U.S. Federal Reserve Chair Janet Yellen kicks off her two-day testimony before Congress with a session scheduled for Tuesday morning before the Senate Banking Committee.
In prepared remarks, she said a cautious approach to monetary policy remains appropriate and while the pace of improvement in the labor market has slowed, it's important not to overreact to one or two labor reports. She added that a U.K. vote to leave the EU could have significant economic repercussions. She noted "transitory" pressure on inflation.
"In a vacuum of news where you're just waiting for a poll to come out, really for the results to come out (Thursday), she could fill the void a little bit," said Jeremy Klein, chief market strategist at FBN Securities.
Investors are listening closely for clues on the Fed's view on the economy and reasons for the recent shift in tone away from a summer rate hike. Analysts do not expect major changes in her stance on monetary policy since the Fed just met last week.
The U.S. dollar index held about half of a percent higher, with the euro near $1.125 and the yen near 104.8 yen versus the greenback as of 4 p.m. p.m. ET.
Pound sterling struggled for gains against the dollar to trade near $1.462. Earlier, sterling hit its highest against the greenback since January 4 and surged more than 2 percent Monday for its best day since late 2008.
U.S. crude oil futures for July delivery settled 52 cents lower, or 1.05 percent, at $48.85 a barrel.