Updated with technical analysis on Delta.

The outlook appears to be brightening for U.S. airline shares, which have generally suffered a down year despite generating record or near-record profits.

During the third quarter, airline shares gained 12%, compared with the 3.3% gain in the S&P 500

The gains didn't erase full year losses, however. Of the nine largest airlines, only two show 2016 gains, with Hawaiian(HA) - Get Report up 45% and Spirit(SAVE) - Get Report up 11%. Among the rest, Delta(DAL) - Get Report and JetBlue(JBLU) - Get Report  are down 20%, Allegiant(ALGT) - Get Report  fell 17%, Alaska(ALK) - Get Report  is down 14%, American(AAL) - Get Report  and Southwest(LUV) - Get Report  fell 9% and United(UAL) - Get Report  has tumbled 5%.

Nevertheless, "the general sentiment around the airlines is starting to improve due to bullish comments about September," said Cowen & Co. analyst Helane Becker, in a report issued Monday.

"It was an interesting {third} quarter, riddled with technology and network glitches," Becker wrote. "Oil prices were erratic but generally averaged in line with initial expectations. Fares remain low; however, load factors improved during the end of August and into September, which led to modestly improving unit revenue trends."

Throughout the year, carriers have been caught in a world where Wall Street focused on a key metric, passenger revenue per available seat mile, which has been in negative territory.

The counter-intuitive theory has it that higher fuel costs would offer a solution, because they would lead to fare increases that would boost revenue.

During the year, airlines also have faced overcapacity on both trans-Atlantic and some trans-Pacific routes, and increasing completion on domestic routes from ultra-low cost carriers Spirit, Frontier and Allegiant.

Airline shares got a boost on Tuesday, when Delta reported higher-than-expected September PRASM. Other carriers will report September traffic during the coming week.

Delta said consolidated September PRASM fell 3% as a result of continued overcapacity in the trans-Atlantic and "headwinds from prior year yen hedge gains."

The 3% decline was better than the 4% decline that Delta projected earlier. Delta said pressures from close-in domestic yields moderated slightly in September with the implementation of its fall schedule.

In late afternoon trading Tuesday, Delta traded at $40.20, up 22 cents. American traded at $37.64 down six cents. United traded at $53.66, up 40 cents.

 "As a result of the better-than-expected September result, we estimate that DAL is tracking to (minus 6.7%) for the quarter which would be a modest beat to the (minus 7%) guidance provided last month," wrote Credit Suisse analyst Julie Yates, referring to the quarterly PRASM guidance.

"The company noted that September trended in-line with its expectation for fall schedule cuts to support better unit revenues, particularly on close-in {bookings}," Yates said.

From a technical perspective, technical analyst Jonas Elmerraji says Delta is "breaking out of a long-term consolidation pattern."

Image placeholder title

Here's Elmerraji's recommendation for how to trade the stock:

In short, after shedding 20% of its market value since the calendar flipped to January, Delta is finally looking "bottomy" this fall. And we're getting a buy signal today.

Delta has spent the last three months forming an ascending triangle pattern, a bullish price setup that's formed by horizontal resistance up above shares at $40, along with uptrending support to the downside. As Delta's stock price has pinballed in between those two technically significant price levels, it's been getting squeezed up against that $40 price ceiling. Today's breakout above $40 is a buy signal.

If you're buying into Delta here, risk management is key. It makes sense to park a protective stop on the other side of Delta's most recent swing low at $37.

For more on how to trade the biggest airlines, check out "6 Airline Stocks You Should Buy in October -- and 3 to Sell."

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.