The stock market struggled to find direction on Wednesday, as traders weighed comments from central bank chiefs on the economy's and interest rate outlooks.

The S&P 500 finished almost flat and above the Fibonacci 38.2% retracement level of around 3,815 which investors have been watching closely. Portfolio rebalancing on a quarterly basis contributed to market volatility. Bonds and the dollar both rose.

The United States is in "strong shape," according to Federal Reserve Chair Jerome Powell, and is "well-positioned to withstand tighter monetary policy." He reiterated his commitment to lowering inflation, but warned that the process would be "painful." Powell took part in a panel discussion alongside European Central Bank President Christine Lagarde and Bank of England Governor Andrew Bailey.

Fears that a hawkish Fed will tip the economy into a recession have gripped markets this year. The S&P 500 is on track for its worst quarter since March 2020, as treasury yields rise. The US central bank was in denial about inflation, according to Rob Arnott of Research Affiliates, this has put it on a path to causing a recession if it hasn't already.

As traders increased their bets on a US recession eventually halting the central bank's aggressive tightening campaign, the bond market shifted to price in a half-point rate cut in the Fed's benchmark rate at some point in 2023.

Loretta Mester, president of the Federal Reserve Bank of Cleveland, said officials should not be complacent about rising long-term inflation expectations and should act forcefully to reduce price pressures. Consumer spending expanded at the slowest rate of the pandemic recovery in the first quarter, according to data released on Wednesday, implying that the economy is in worse shape than previously thought.

Chief financial officers are becoming increasingly pessimistic about the economy this year, with one measure of sentiment falling to its lowest level in nearly a decade. According to the latest quarterly results of the CFO survey, a collaboration of Duke University's Fuqua School of Business and the Federal Reserve Banks of Richmond and Atlanta, respondents reduced their growth expectations.

Peloton Interactive Inc. fell after UBS reaffirmed its sell rating on the at-home fitness company, citing negative user trends. Carnival plc fell after Morgan Stanley warned that if there is another demand shock, the cruise vacation company's shares could lose all of their value. The stock of Bed Bath & Beyond inc. fell after the home-goods retailer reported disappointing earnings.