NEW YORK (Reuters) - Wall Street edged up to a record high on Wednesday as gains in consumer discretionary and energy stocks offset losses in technology heavyweight Apple Inc.

Shares of Apple AAPL.O dropped 0.8 percent on concerns that the company's newly launched iPhone X is too expensive and because its availability starting in November was later than expected. With the widely held stock up 37 percent so far this year, some analysts said it was time to cash in gains.

“Apple to a certain extent is a ‘sell the news’ event,” said Art Hogan, chief market strategist at Wunderlich Securities in New York. “A great deal of expectation has been built into the stock.”

Even with Apple’s losses, the S&P 500, Dow Jones industrial average and the Nasdaq all closed at record levels, helped by other consumer stocks.

The S&P energy index .SPNY rose after the International Energy Agency said that a global surplus of crude was starting to shrink.

The Dow Jones Industrial Average .DJI rose rose 39.32 points, or 0.18 percent, to 22,158.18 The S&P 500 .SPX edged upgained 1.89 points, or 0.08 percent, to 2,498.37, and the Nasdaq Composite .IXIC added 5.91 points, or 0.09 percent, to 6,460.19.

The indexes have hit several records this year, despite setbacks caused by turmoil in the White House, the timing of U.S. interest rate hikes, doubts about President Donald Trump’s ability to push through his pro-business reforms, and lately, tensions over a nuclear-weapons-capable North Korea.

The S&P 500, up 11.6 percent in 2017, is trading at 17.6 times expected earnings, expensive compared with its 10-year average of 14.3, according to Thomson Reuters Datastream.

Shares of credit score provider Equifax EFX.N tumbled 14.6 percent and hit a more than 1-1/2-year low after an apology by company Chief Executive Richard Smith for a massive data breach failed to appease investors.

“Of course it should be getting pounded and the situation is only getting worse,” said Ken Polcari, director of the NYSE floor division at O’Neil Securities in New York. “They have a huge problem on their hands. The fact the (CEO) has been so cavalier – it took him five days to write a response – it’s a disaster.”

Target Corp TGT.N rose 2.8 percent after the retailer said it would hire 100,000 workers for the holiday season, 43 percent more than last year.

Chevron Corp CVX.N climbed 1.5 percent, boosting the Dow, while a 1.7 percent rise in Amazon.com Inc AMZN.O boosted the Nasdaq.

Nordstrom Inc JWN.N gained 6.0 percent after the company's founding family selected private equity firm Leonard Green & Partners to help take it private.

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

The S&P 500 posted 31 new 52-week highs and one new low; the Nasdaq Composite recorded 103 new highs and 17 new lows.

About 6.2 billion shares changed hands on U.S. exchanges, above the 5.8 billion 20-day average.