The major equity indexes chalked up one-month highs on Wednesday as strong earnings from Bank of America and Goldman Sachs raised investor sentiment.

Goldman Sachs shares rose 9.5 percent, providing the greatest positive influence to the Dow Jones Industrial Average, after the bank reported quarterly revenue and earnings that exceeded Street estimates. The shares registered their largest daily percentage gain in nearly 10 years.

Bank of America shares rose 7.2 percent, leading the S&P 500 higher, after the bank reported a higher-than-expected quarterly earnings number on growth in its loan book. The shares posted their largest one-day percentage gain in 6-1/2 years.

The two banks’ results drove a 2.2 percent gain in the S&P 500 financial index, which was by far the largest gainer among the S&P’s major sectors. The S&P banking index gained 2.7 percent.

A strong start to the earnings season, along with trade optimism and hopes of a slower pace in the Federal Reserve’s interest-rate hikes, have helped S&P 500 index recoup some of its losses from a recent rout. The index is now 10.7 percent away from its Sept. 20 record close after having fallen as much as 19.8 percent below that level.

With Wednesday’s gains, the S&P 500 came within striking distance of its 50-day moving average, a key indicator of short-term trends, for the first time since Dec. 4. The Nasdaq crossed its 50-day moving average on Tuesday for the first time since Dec. 3.

Stocks slightly pared gains in the last half-hour of trading after the Wall Street Journal reported federal prosecutors were investigating Huawei Technologies, the world’s largest telecommunications equipment maker, for allegedly stealing trade secrets from U.S. businesses.

Among other stocks, United Continental Holdings rose 6.4 percent after the airline posted a quarterly earnings number that exceeded expectations.

Shares of First Data were up 21.1 percent after Fiserv said it had agreed to buy the payment processor for $22 billion in the largest-ever deal within the digital payments industry. Fiserv’s shares fell 3.3 percent.

Nordstrom fell 4.8 percent after the department store forecast full-year earnings at the lower end of its prior estimates.

Ford fell 6.2 percent after the automaker forecast a weaker-than-expected fourth quarter profit and said tariffs could erode its 2019 earnings.

Approximately 7.48 billion shares changed hands on the major domestic equity exchange, as compared to the 8.69 billion share average over the past 20 trading days.