U.S. stocks advanced Tuesday, snapping a four-day losing streak and overcoming opening losses after the Bank of Japan announced a surprise rate hike.

The Dow Jones Industrial Average rose 92.47 points, or 0.28%, to close at 32,850.01. The S&P 500 rose 4.07 points, or 0.11%, to close at 3,821.73, and the Nasdaq rose 1.08 points, or 0.01%, to close at 10,547.11.

The tech-heavy Nasdaq gained despite Tesla shares plunging on continued concerns that CEO Elon Musk has overextended his time and money with the acquisition of Twitter. Tesla (TSLA) shares dropped 8.05%, or $12.07, to close at $137.80.

The markets also shook off overnight news that the Bank of Japan had unexpectedly raised interest rates on a 10-year government bond by 0.5%. Most central banks have been raising rates along with the Federal Reserve to fight inflation. The Bank of Japan was a noticeable exception until Tuesday.

The Fed raised rates by 0.5% at its last meeting of the year earlier this month and indicated more hikes were likely in 2023. Recent economic data suggests the rate hikes may be having the desired effect of slowing inflation, but concerns persist that the Fed's aggressive actions may push the economy into recession.

Some stocks that rose Friday included Amazon (AMZN), which closed at $85.19, up $0.27, or 0.32%. Meta Platforms' (META) price of shares rose $2.61, or 2.28%, to close at $117.09.

"There's still no Santa sighting. Buckle up," Louis Navellier, founder of Navellier & Associates, told CNBC. "One would like to think all the bad news is in. There are no more Fed moves until February at the earliest. We're not gapping down but certainly not clawing back last week's losses."