All major stocks indexes rose, but gains were led by the riskier parts of the market. The Russell 2000, an index of small-company stocks, climbed for a fourth straight day. The Dow Jones transportation average, seen as a leading indicator for the broader economy, also jumped.
The gains suggest that investors are getting more confident about the economy's prospects. In the first half of the year, stock markets were powered by the safer companies that paid large dividends.
"When you see that leadership from the smaller caps that's probably a good sign overall for the bigger blue chips to potentially follow suite," said Ryan Detrick, a senior technical strategist at Schaeffer's Investment Research. "People are leaving the more defensive areas."
The Russell 2000 rose eight points, or 0.9 percent, to 1,018.05. It has gained 4.2 percent in July and is moving deeper into record territory. The index has risen more this year than its large-company counterparts, the Dow Jones industrial average and the Standard & Poor's 500 index.
The Dow Jones transportation index rose the most among major U.S. indexes Tuesday, led by strong gains for Alaska Air Group and FedEx.
The index jumped 148 points, or 2.4 percent, to 6,446. Alaska Air Group rose 7 percent after it forecast an additional $50 million a year in revenue from increased fees. FedEx rose 6 percent on speculation that William Ackman's hedge fund, Pershing Square, could invest in the company.
Wall Street is also turning its attention to corporate earnings. The second-quarter results should give traders and investors fresh insights into the economy. Market watchers spent most of June trying to figure out where the Federal Reserve was headed with its economic stimulus program.
Along with the quarterly results, investors want to see how confident companies are about the rest of the year, said Cam Albright, director of asset allocation for Wilmington Trust Investment Advisors.
Major U.S. stock indexes have notched a series of all-time highs this year on expectations that earnings will remain at record levels.
"A lot of what the market has justified its advances on is a strong second-half for the economy and a strong second-half for earnings," said Albright. "It's important that we see verification of that."
Alcoa was the first major company to announce second-quarter results. The aluminum maker late Monday reported a second-quarter loss that wasn't as big as financial analysts feared. The company benefited from strong demand for aluminum used in autos and airplanes, although that was offset by weaker prices.
Traders weren't blown away by the results, though. After initially rising, the stock ended down 1 cent, or 0.1 percent, to $7.91.
Yum Brands, which owns KFC, Pizza Hut and Taco Bell, and Family Dollar store are among the companies reporting their earnings this week. JPMorgan Chase and Wells Fargo will also report.
The Dow Jones industrial average rose 75 points, or 0.5 percent, to 15,300.34. The S&P 500 index gained 11 points, or 0.7 percent, to 1,652.32 The Nasdaq composite rose 19 points, or 0.6 percent, to 3,504.26
The S&P 500 has risen for four straight days, its best streak in almost two months. Gains were led by industrial firms and companies that provide raw materials. Telecommunications companies, which investors turn to when the economic outlook is gloomier, fell.
The S&P 500 is now just 1 percent below its May 21 record of 1,669. It was down almost 6 percent to 1,573 on June 24.
Stocks have recovered since Fed Chairman Ben Bernanke said that the central bank planned to reduce its economic stimulus.
The central bank is buying $85 billion in bonds a month to keep interest rates low and encourage borrowing and spending. That stimulus has been a major support in the stock markets' five-year rally.
Stock markets are likely to become more volatile as investors try to assess when and how quickly the central bank will cut back on stimulus, said Dean Junkas, chief investment officer of Wells Fargo Private Bank.
"More volatility in the second half of the year is what we're expecting," said Junkas.
In government bond trading, the yield on the 10-year Treasury note was little changed at 2.64 percent early Tuesday. The yield has pulled back after surging to 2.74 percent Friday, its highest level in almost two years, after the government reported strong hiring for June.
In commodities trading, the price of oil rose 17 cents, or 0.2 percent to $103.33 a barrel. Gold rose $12, or 1 percent, to $1,246.90.
Among other stocks making big moves:
-- WD-40 rose $3.13, or 5 percent, to $60.77 after the company reported earnings that beat financial analysts' forecasts.
-- Barnes and Noble rose 64 cents, or 3.6 percent, to $18.32 after the bookseller said Monday its CEO is leaving after three years. The company didn't name a replacement.