(Reuters) - Major U.S. stock indexes established record highs on Tuesday, led by bank stocks after Federal Reserve Chair Janet Yellen said it would be unwise to wait too long to raise interest rates.

Apple AAPL.O racked up a record high close for the second straight session, contributing to gains in the S&P 500, Dow Jones Industrial Average and Nasdaq Composite indexes.

Yellen said delaying rate hikes could force the U.S. central bank to tighten monetary policy quicker down the line, which could risk a recession. She also expressed uncertainty over economic policy under the Trump administration.

Banks, expected to gain from higher interest rates, led the market higher. Goldman Sachs GS.N rose 1.29 percent and Bank of America BAC.N added 2.82 percent. The S&P 500 financial index .SPSY jumped 1.24 percent.

So far in 2017, the KBW banking index .BKX has increased 4.5 percent.

President Donald Trump’s pro-business stance sparked a record-setting rally in stocks following his November election. However, he has given scant detail on his policies, leaving the Fed with limited visibility about the economy’s future direction.

Speaking to the U.S. Senate Banking Committee, Yellen did not indicate whether the Fed still planned to raise rates three times this year, nor did she indicate whether a hike might come in March or in June, as most analysts expect.

Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., February 7, 2017. REUTERS/Brendan McDermid

“With the new president, there is still the uncertainty of the economic policy,” said Jeff Carbone, co-founder of Cornerstone Financial Partners in Charlotte, North Carolina. “How much growth we get out of the market will affect policymaking and how quickly they need to react.”

The Dow Jones Industrial Average .DJI climbed 0.45 percent to end at 20,504.41 points, while the S&P 500 .SPX gained 0.40 percent to 2,337.58.

The Nasdaq Composite .IXIC added 0.32 percent to 5,782.57.

Yellen's comments lifted the dollar .DXY and U.S. Treasury yields US10YT=RR.

Eight of the 11 major S&P sectors rose, with healthcare .SPXHC adding 0.73 percent.

Apple rose as high as $135.09, an intraday record high, before ending with a gain of 1.30 percent at $135.02, its highest-ever closing price.

General Motors GM.N added 4.84 percent after Peugeot owner PSA Group PEUP.PA said it is in talks to buy GM's European Opel business.

The prospects of sector consolidation caused Fiat Chrysler FCAU.N to jump 4.39 percent, while Ford F.N gained 0.72 percent.

Advancing issues outnumbered declining ones on the NYSE by a 1.09-to-1 ratio; on Nasdaq, a 1.31-to-1 ratio favored advancers.

The S&P 500 posted 60 new 52-week highs and no new lows; the Nasdaq Composite recorded 124 new highs and 22 new lows.

About 6.7 billion shares changed hands on U.S. exchanges, in line with its daily average over the last 20 sessions.