(Reuters) - Wall Street extended its rally on Wednesday, with the S&P 500 and the Nasdaq hitting record highs for the fourth straight session as technology companies pushed indexes higher and promising trade negotiations stoked investor sentiment.

Apple Inc AAPL.O led the technology sector's advance, and the iPhone maker's shares hit an all-time closing high at $222.98.

The FAANG group of momentum stocks also got a boost from Morgan Stanley's price target increases for Amazon.com AMZN.O and Alphabet Inc GOOGL.O.

Amazon's stock gained 3.4 percent, leading the consumer discretionary sector's .SPLRCD advance, as the company edged closer to becoming the second U.S. company, after Apple, to reach $1 trillion in market value.

The remaining FAANG stocks, Facebook Inc FB.O and Netflix Inc NFLX.O, closed slightly lower.

Canada appeared to be taking a more conciliatory approach to its ongoing talks with the United States aimed at salvaging the trilateral North American Free Trade Agreement (NAFTA), days after Washington said it had struck a deal with Mexico.

“The trade situation is adding to the rally as opposed to being a headwind as it’s been for the past couple of months,” said Bucky Hellwig, senior vice president at BB&T Wealth Management in Birmingham, Alabama.

Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., August 28, 2018. REUTERS/Brendan McDermid

As the summer nears its end, light trading volume that sometimes plagues the market seems to have worked in its favor.

“Historically, light volume in August has generally contributed to a weak month in terms of performance,” Hellwig said. “But favorable fundamentals in the last couple of weeks have reversed that pattern.”

Among the economic fundamentals, the Commerce Department released its second reading of second-quarter GDP, showing the U.S. economy grew at an upwardly-revised annual rate of 4.2 percent in the quarter, its best performance in nearly four years.

The Dow Jones Industrial Average .DJI rose 60.55 points, or 0.23 percent, to 26,124.57, the S&P 500 .SPX gained 16.52 points, or 0.57 percent, to 2,914.04 and the Nasdaq Composite .IXIC added 79.65 points, or 0.99 percent, to 8,109.69.

Eight of the 11 major sectors of the S&P 500 ended the session in positive territory, with the largest percentage gains coming from the consumer discretionary and technology .SPLRCT sectors.

Restaurant operator Yum China Holdings Inc YUMC.N extended its rally, and was up 5.5 percent after rejecting a $17.6 billion buy-out bid from a Chinese consortium.

Among losers, Dick's Sporting Goods Inc DKS.N fell 2.2 percent following an underwhelming earnings report, a drop in same-store sales driven by tighter gun controls and a decline in Under Armour UAA.N sales.

Shares of American Eagle Outfitters Inc AEO.N dropped 6.5 percent after posting disappointing second quarter results and providing a lackluster forecast.

Advancing issues outnumbered declining ones on the NYSE by a 1.60-to-1 ratio; on Nasdaq, a 1.55-to-1 ratio favored advancers.

The S&P 500 posted 61 new 52-week highs and 1 new low; the Nasdaq Composite recorded 112 new highs and 24 new lows.

Volume on U.S. exchanges was 5.63 billion shares, compared to the 6.12 billion average over the last 20 trading days.