Major U.S. indexes closed mostly higher on Friday, with several posting weekly gains, despite a recent string of daily swings on Wall Street as traders grapple with what’s next for the economy. economy.

The S&P 500 index rose 0.5% after spending the day hovering between a 0.6% gain and a 0.4% decline. The Dow Jones industrial average rose 0.4%, while the Nasdaq composite fell 0.2%.

The indices have alternated almost every day this week between gains and losses. Investors are trying to guess what’s next for inflation and the global economy as the fallout from The Russian invasion of Ukraine keep playing.

The benchmark S&P 500 index posted a 1.8% gain for the week. This follows a 6.2% rise last week. The tech-heavy Nasdaq and Dow also posted a weekly gain over the past two weeks.

Bond yields rose significantly. The 10-year Treasury yield jumped to 2.48% from 2.34% Thursday night. Crude oil prices rose moderately after slipping earlier in the day.

“We are still in this relatively neutral outlook right now, trying to digest what is happening at the Federal Reserve, watching events in Russia and Ukraine, and then preparing for the first quarter earnings season,” said Tom Hainlin, national investment strategist at US Bank Wealth Management.

The S&P 500 rose 22.90 points to 4,543.06. The Dow gained 153.30 points to 34,861.24 and the Nasdaq fell 22.54 points to 14,169.30.

Stocks of smaller companies also rose. The Russell 2000 Index added 2.54 points, or 0.1%, to 2,077.98.

Banks and energy stocks were a big part of the S&P 500’s gains. Rising bond yields helped rebound banks, which rely on higher yields to charge more lucrative interest on loans. Bank of America rose 1.5%.

Tech stocks fell and dampened gains elsewhere in the market. Big tech companies have outsized values ​​that tend to lend more leverage to push the larger market up or down. Chipmaker Nvidia fell 1.6%.

The price of benchmark U.S. crude rose 1.4% to $113.90 a barrel, while Brent crude, the international standard, rose 1.4% to 120.65 $. Prices are still up around 50% globally for the year. Rising oil prices helped push up energy inventories. Exxon Mobil gained 2.2%.

Oil prices have been volatile since the start of Russia’s war against Ukraine in February. Russia is the second largest exporter of crude. Energy prices were already high, but the dispute raised concerns that a worsening supply shortage could further aggravate the persistent rise in inflation.

The United States and Europe have announced partnership Friday to reduce the continent’s dependence on Russian energy in hopes of further isolating Moscow for its aggression. Russia has threatened to make Europe pay for natural gas exports in rubles, the value of which has been reduced due to sanctions and other actions. The Russian economy has been hurt by governments that have cut it off from international banking and trade.

The conflict in Ukraine has heightened global concerns about rising inflation and the possibility of economic growth slowing even more than expected. A investigation Friday showed that business confidence in Germany, Europe’s largest economy, fell sharply in March due to the conflict in Ukraine.

Central banks, including the Federal Reserve, are poised to raise interest rates in an attempt to blunt the impact of rising inflation, which has only worsened Russia’s war in Ukraine. The conflict is also pushing up the prices of wheat and other raw materials, with Russia and Ukraine being the main global suppliers.