Is Goldman Sachs Group Inc. (GS) getting its mojo back?

The Wall Street firm, after a worst-in-class trading performance in 2017, is poised to report its second-straight quarter of besting rivals like JPMorgan Chase & Co. (JPM) and Morgan Stanley (MS) in the business of transacting in stocks and bonds, according to the brokerage firm RBC Capital Markets.

Goldman probably increased trading revenue by 23% in the second quarter, RBC estimates. That figure dwarfs an estimated 6.5% gain at JPMorgan, the biggest U.S. bank, as well as a 7.2% gain at Morgan Stanley, Goldman's longtime rival in the securities business. Citigroup Inc. (C) and Bank of America Corp. (BAC) probably saw revenue fall in the quarter, according to RBC.

A rebound in the trading business could help restore investors' faith in New York-based Goldman as the firm's executives, led by CEO Lloyd Blankfein and President David Solomon, try to shore up a lagging stock price. The firm's shares are down 2% since the start of 2017, even as rival Wall Street firms have posted double-digit gains.

The trading predictions come as the biggest U.S. banks prepare to post second-quarter results, starting with JPMorgan, Citigroup and Wells Fargo & Co. (WFC) on Friday. Bank of America, Goldman and Morgan Stanley are scheduled to report next week.

Goldman "should have better results in the second quarter," said Brian Kleinhanzl, an analyst with the brokerage firm Keefe, Bruyette & Woods in New York. "But we still need to see sustainable sings of a pickup to confirm that it's a trend."

The Wall Street firm's trading results were so horrible last year - total revenue from that business tumbled by 18% -- that Blankfein had to stave off investor pressure by announcing a three-year plan to increase earnings from other areas, such as lending to households and businesses.

Goldman has also shook up management, announcing the retirement of former Co-President and CFO Harvey Schwartz as well as the departures of two of its three trading co-heads, Pablo Salame and Isabelle Ealet.

Last month, the firm faced the added embarrassment of failing a Federal Reserve "stress test" designed to gauge whether big banks could make planned payouts to shareholders via dividends and stock buybacks and still have enough of a financial cushion to survive a severe recession. The Fed agreed to allow Goldman to continue making payouts, while restricting the size of the capital returns to the prior year's levels.

Through the turmoil, though, Goldman maintained its perch as the No. 1 advisor on mergers globally in the first half of 2018, according to Dealogic.

Total fees in the second quarter from investment banking, which includes merger advisory as well as stock and debt underwriting, climbed by an estimated 2.4% from a year earlier, according to RBC. Rivals, by contrast, probably saw revenue from the business decline.

Goldman's projected trading performance came as the Standard & Poor's 500 Index climbed 2.9% in the second quarter, buoyed by optimism over U.S. economic growth following President Donald Trump's December tax cuts but buffeted by investor anxiety over the repercussions of a trade war with China and other nations. Share-trading volumes fell by 3% on the New York Stock Exchange but were up 2% on the Nasdaq; stock-price volatility jumped by 34%, according to Goldman's own analysts.

Interest-rate increases by the Federal Reserve, meanwhile, helped drive client activity in bonds and foreign exchange, even as the level of price swings was more muted. Corporate-bond-trading volumes climbed 4% from a year earlier, while primary-dealer trades in U.S. government bonds increased by 5%, RBC estimated. Yields on the 10-year Treasury note climbed by 0.11 percentage point to 2.858%.

Foreign-exchange volumes on the Chicago Mercantile Exchange rose by 18% as the dollar strengthened, according to RBC.

Goldman's outperformance is partly optical, according to Credit Suisse analyst Susan Roth Katzke: Last year's trading results were so awful that improvement should be easier to come by.

More from Markets

State Street Gets Pummeled on Software Deal; Pizza Wars Are Raging -- ICYMI

State Street Gets Pummeled on Software Deal; Pizza Wars Are Raging -- ICYMI

Schlumberger Stock Dips as Investors Ignore Start of 'Earnings Liftoff'

Schlumberger Stock Dips as Investors Ignore Start of 'Earnings Liftoff'

GSK Shares Climb as Board Is Said to Mull Breakup of Pharma Giant

GSK Shares Climb as Board Is Said to Mull Breakup of Pharma Giant

Stocks End Close to Home

Stocks End Close to Home

Jim Cramer on Bank of America, Tariffs and the Goldman Sachs CEO Change

Jim Cramer on Bank of America, Tariffs and the Goldman Sachs CEO Change