Trading revenue gains of up to 17 percent helped JPMorgan Chase & Co, Bank of America Co, Goldman Sachs Group Inc and Morgan Stanley beat market expectations, and executives said they remained cautiously optimistic about the trading environment.

Citigroup Inc was the only major bank to report lower trading revenue, citing challenges in fixed income markets.

Those five Wall Street banks generated roughly $44 billion in trading revenue during the first half of the year, a seven-year high when adjusting for one-time items, said Guy Moszkowski, bank analyst with Autonomous Research.

"There's been much more volatility," he said. "It's been in fits and starts, but the thesis is still that customers are going to be more active."

Bank executives expressed some faith robust trading conditions will persist.

Escalating tensions between the United States and major trade partners, combined with the likelihood that the Federal Reserve will lift interest rates again in September, could encourage investors to protect their portfolios or seize opportunities, they said.

"Despite the persistence of geopolitical and economic risks, the backdrop remains constructive," Goldman Sachs Chief Financial Officer Marty Chavez told analysts on Tuesday.

He mentioned a stronger U.S. dollar, higher oil prices and shifts in bond yields as driving the bank's 24 percent trading revenue gain.

JPMorgan's finance chief, Marianne Lake, pointed to volatility in emerging markets and European sovereign debt to explain a 13 percent rise in trading revenue.

"There's just more catalysts in the market and, just generally, more client participation," she said.

Wall Street trading desks started to see their fortunes fade in 2010 as the huge relief rally that came after the 2007-2009 financial crisis dissipated.

New regulations on proprietary trading, derivatives and capital crimped big banks' trading profits in the following years, as did the popularity of passive investment products.

Market volatility has generally been subdued since 2011, apart from blips related to unexpected events like Switzerland's central bank doing away with a cap on the franc in 2015.

As Wall Street banks overhauled trading businesses and waited for markets to pick up, revenue tracked almost consistently downward since 2009.

The $71 billion in trading revenue generated last year by JPMorgan, Citigroup, Bank of America, Goldman Sachs and Morgan Stanley compared with a peak of nearly $100 billion in 2009.

There have been differences in opinion about whether the business would ever fully recover.

Executives at Goldman Sachs have expressed more confidence than those at other banks, including rival Morgan Stanley.

On Wednesday, Morgan Stanley CFO Jon Pruzan warned conditions could deteriorate later in the year due to seasonal declines and international flare-ups.

"Trade tensions, political uncertainties across Europe and the potential for an inverted yield curve, to name a few, are factors that remain at play," he said.

Many consider an inverted yield curve to be a sign of a looming economic slowdown. The U.S. yield curve has flattened in recent months due to concerns over the global economy.

(Editing by Lauren Tara LaCapra and Meredith Mazzilli)

By Matt Scuffham and Rishika Dugyala