A late afternoon wave of buying sent US stocks higher, the AP reports, but the market still ended the week with a loss. Health care and energy companies powered the gains Friday. UnitedHealth Group added 2.3% and Chevron rose 1.8%. The market got a boost in the afternoon after President Donald Trump expressed optimism that the US and China will resolve their trade dispute. Large retailers and media and communications companies were the laggards. Chipmaker Nvidia plunged 18.8% after saying it had a large number of unsold chips because of a drop in cryptocurrency mining. The S&P 500 rose 6 points, or 0.2%, to 2,736. The Dow Jones Industrial Average climbed 123 points, or 0.5%, to 25,413. The Nasdaq lost 11 points, or 0.2%, to 7,247. (More stock market stories.)