Stocks rose for the fourth day in a row Tuesday as they continued to recover the ground they lost last week. Major indexes approached record highs again.

Most of the gains went to banks, which surged as bond yields jumped. That will allow them to charge higher rates on loans. Banks took steep losses last Wednesday, when stocks had their worst day since September.

advertisement | advertise on newsday

The four-day rally has restored most of the market’s losses and the Standard & Poor’s 500 index is almost back to record highs.

“The market was simply reminded that there’s political risk out there and it reacted to that reminder,” said Matthew Peterson, chief wealth strategist for LPL Financial. Peterson said he doesn’t think long-term investors have made big changes to their portfolios in response to last week’s drop, which followed allegations President Donald Trump asked the FBI to end an investigation into former National Security Adviser Michael Flynn.

The S&P 500 added 4.40 points, or 0.2 percent, to 2,398.42. The Dow Jones industrial average edged up 43.08 points, or 0.2 percent, to 20,937.91. The Nasdaq composite rose 5.09 points, or 0.1 percent, to 6,138.71. The Russell 2000 index of small-company stocks gained 3.84 points, or 0.3 percent, to 1,380.98.

Bond prices turned lower. The yield on the 10-year Treasury note rose to 2.28 percent from 2.25 percent.