Goldman Sachs Group Inc. has recently been sketching out a future that includes retail deposits, new technology and online loans.

But the Wall Street firm’s surprisingly strong earnings report Tuesday was grounded in one of its oldest businesses: trading.

Led by Chairman and Chief Executive Lloyd Blankfein, a former trading executive, Goldman...