U.S. stocks closed higher Wednesday, with the Dow ending at a record high for the seventh day in a row as better-than-expected earnings boosted optimism on Wall Street.
The Dow Jones industrial average extended gains for nine consecutive days for the first time since 2013, with Microsoft contributing most to the upside.
The S&P 500 closed at a new record level, led by technology which had its best day in 16 years. The Nasdaq composite had its highest close of the year, helped by a 2 percent gain in biotech.
"We're seeing a strong rotation out of the previous winners," said Paul Schatz, president and chief investment officer at Heritage Capital. "The defensive trade is definitely off."
Defensive sectors like consumer staples and utilities were the biggest laggards on the S&P Wednesday.
"You're seeing healthier leadership with semis, tech, and biotech that can fuel the market another leg higher," Schatz said.
Bank results continued to surprise Wednesday, with Morgan Stanley reporting earnings of 75 cents per share versus consensus expectations of 59 cents, according to Thomson Reuters. Morgan Stanley joined Goldman Sachs, Citigroup, JPMorgan Chase, and Bank of America on the list of U.S. financial institutions topping second-quarter profit forecasts.
"This suggests the big banks have been managing global uncertainty pretty well," said Jack Ablin, chief investment officer at BMO Private Bank. "Investors are celebrating Microsoft and Morgan Stanley, which are part of the enthusiasm."
The Dow hit a new intraday high Wednesday led by Microsoft, which beat on earnings and revenue as its cloud product Azure saw revenue growth of 102 percent.
Sixty four percent of S&P 500 companies that had reported as of Tuesday morning topped earnings estimates, according to Thomson Reuters, compared to a long-term average of 63 percent over the past 22 years.
"Investors are playing the 'no-alternative' card, which means since earnings are not terribly disappointing, the rally continues," said Peter Cardillo, chief market economist at First Standard Financial.
The U.S. dollar hit a four-month high as Fed rate hike talk picks up and economic data continues to strengthen.
U.S. housing starts rose more than expected in June, and Fed funds futures rates showed an uptick in rate hike expectations. According to the CME Group's FedWatch tool, the rates show investors see a roughly 40 percent chance the Fed will hike rates by its December meeting, compared with less than 20 percent a few weeks ago.
"I think it's a combination of data, and it's a safe haven because the geopolitical situation in Turkey certainly is not over," Cardillo said. "People are just being cautious."
Markets awaited an announcement in Turkey for emergency measures in the aftermath of a failed military coup. The MSCI Turkey ETF fell more than 2.5 percent.
"Political risk is always a factor when investing in emerging markets, the events in Turkey highlight this," said William Scholes, investment manager at Aberdeen Asset Management. "Companies in the country are among some of the best in emerging markets, despite the political environment."
Roughly 50,000 military officers, police, and other Turkish citizens were suspended from work or detained since the military coup in the country, which borders Syria and is a Western ally against Islamic State, Reuters reported.
Sterling moved higher after the Bank of England released its report on economic impact from last month's Brexit vote. The report showed no clear evidence of slowing economic activity, with signs that demand for credit was easing and companies did not expect any near-term impact on capital spending, according to Reuters.
"Anything that says Brexit won't have a significant negative impact, or that it will be contained to the U.K., is a positive for U.S. stocks," said Kate Warne, investment strategist at Edward Jones. "U.S. stock are taking their cues from the European market in response."
The British pound traded at $1.32 against the dollar. China's yuan rose as the People's Bank of China strengthened its reference rate, which limits moves in the currency. The euro traded at $1.10, and earlier hit its lowest level against the dollar since June 27.