"I think we're transitioning from an interest-rate-driven market ... to an earnings-driven market," said Jeffrey Saut, chief investment strategist at Raymond James. "If the market is going to get hit, it's going to be by something unforeseen. Otherwise, I think we go higher."
The Dow Jones industrial average briefly gained 100 points in early trade, but lost most of its steam and closed about 20 points higher. Nike contributed the most gains on the Dow. The benchmark S&P 500 advanced 0.2 percent, with materials leading, and came within less than a point of hitting its all-time intraday high.
The Nasdaq composite outperformed, gaining 0.3 percent and broke above its previous all-time intraday high of 5,271.36 as Apple gained 0.4 percent.
"I'm not surprised the market did not go down; I am surprised it shot up so quickly," said Adrian Day, CEO of Adrian Day Asset Management. "I think what the market is saying is it's not concerned over a rate hike in the near term."
"What we're seeing since Brexit, ... is a relentless underlying strength in the market," said Adam Sarhan, CEO at Sarhan Capital. "The market refuses to fall."
Stocks have recently traded in a very tight range, amid low volume and volatility. The CBOE Volatility index (VIX), widely considered the best gauge of fear in the market, posted one of its best trading days since Brexit on Monday, but has held at near two-year lows.
The S&P posted its 32nd straight session without a 1 percent move on a closing basis on Tuesday. Still, the three major indexes have managed to post record highs recently.
"We've had a quiet market that has lacked volatility for about a month," said Tom Wright, director of equities at JMP Securities.
Raymond James' Saut said "the past 30 days have been the least volatile in over two decades."
On the data front, new home sales for July unexpectedly surged, reaching their highest level in almost nine years. Other data released Tuesday included the Markit Manufacturing PMI for August, which came in at 52.1.
"We know for a while the ever rising cost of renting was an invite to builders to build lower priced homes and hopefully the July data is a sign that they are stepping up and providing them. The demand is there when rents are rising by 4-5% every year. On the other hand, this doesn't change what is likely a secular down shift in the homeownership rate which is at the lowest level since 1965 as of Q2," Peter Boockvar, chief market analyst at The Lindsey Group said in Tuesday a note to clients.
Investors were also preparing for Yellen's speech, due Friday at 11 a.m.
"So far the chances are more or less half and half that the Fed may take another stab at the interest rate. It may be safe to say that traders are somewhat prepared for this, therefore it will be no big surprise if the Fed does increase the interest rate this year," Naeem Aslam, chief market analyst at Think Markets, said in a Tuesday note to clients.
Market expectations for a September rate hike were 18 percent Tuesday, according to the CME Group's FedWatch tool.
"Depending on the tone of her speech, that could change drastically," JMP's Wright said. "I think the market will be range-bound until then."
"That's going to be the massive event this week, other than GDP," Sarhan said. "I think she's got two speeches: one if GDP misses and one for if GDP beats."
The second read for second-quarter GDP is due Friday at 8:30 a.m.
Investors also digested quarterly results from Best Buy and Toll Brothers, among other firms. Best Buy shares soared 19.6 percent after beating expectations on both earnings and revenue. Toll Brothers' stock gained about 8.8 percent.
U.S. crude erased losses in midmorning trade to close 1.46 percent higher at $48.10 per barrel, after Reuters reported Iran is sending positive signals that it may support joint action to prop up oil prices, citing sources.
U.S. Treasurys traded lower, with the two-year note yield near 0.75 percent and the benchmark index around 1.55 percent. The dollar traded flat against a basket of currencies, with the euro near $1.131 and the yen around 100.19.
Overseas, European equities rose, with the Stoxx 600 index rising 0.93 percent. Asian stocks closed mixed overnight, with the Nikkei 225 falling 0.61 percent and the Shanghai composite gaining 0.16 percent.
The Dow Jones industrial average closed 17.88 points higher, or 0.1 percent, at 18,547.3, with Nike leading advancers and Wal-Mart the greatest decliner.
The gained 4.26 points, or 0.2 percent, to 2,186.9, with materials leading eight sectors higher, while consumer staples and utilities lagged.
The Nasdaq advanced 15.47 points, or 0.3 percent, to 5,260.08.
About two stocks advanced for every decliner at the New York Stock Exchange, with an exchange volume of 721.6 million and a composite volume of 2.983 billion at the close.
Gold futures for December delivery rose $2.70 to settle at $1,346.10 per ounce.
On tap this week:
*Planner subject to change.
Earnings: Intuit, Trina Solar
Earnings: HP, Royal Bank of Canada, Guess, Express, WPP Group, Heico, Williams-Sonoma, Workday
9 a.m. FHFA home prices
9:45 a.m. Manufacturing PMI
10 a.m. Existing home sales
1 p.m. $34 billion 5-year note auction
Earnings: Toronto-Dominion Bank, Canadian Imperial Bank, Tiffany, Movado, Burlington Stores, Dollar General, Dollar Tree, Michaels Cos, Autodesk, GameStop, Pure Storage, Splunk
8:30 a.m. Initial claims, durable goods
1 p.m. $28 billion 7-year note auction
Earnings: Big Lots
Fed Chair Janet Yellen speaks at Jackson Hole, Wyoming
8:30 a.m. Real GDP Q2 (second); international trade
9:45 a.m. Services PMI
10 a.m. Consumer sentiment