A Wall Street sign is pictured outside the New York Stock Exchange amid the coronavirus disease (COVID-19) pandemic in the Manhattan borough of New York City, New York, U.S., April 16, 2021.
A Wall Street sign is pictured outside the New York Stock Exchange amid the coronavirus disease (COVID-19) pandemic in the Manhattan borough of New York City, New York, U.S., April 16, 2021. Reuters / Carlo Allegri

U.S. stocks added to their recent rally on Friday after upbeat forecasts from Apple and Amazon.com, putting the Nasdaq on course for its biggest monthly percentage gain since April 2020.

Most S&P 500 sectors were higher in afternoon trading, led by a more than 4% rise in energy. Chevron Corp and Exxon Mobil shares jumped after they reported record quarterly revenue.

Apple Inc shares gained 3.5% after the company said parts shortages were easing and that demand for iPhones was continuing. Amazon.com Inc shot up 11.8% after it forecast a jump in third-quarter revenue from bigger fees from its Prime loyalty subscriptions.

"In today's market, the Amazon and Apple numbers are giving the market support (on) the idea that two large companies that are a large part of the S&P seem so far to be able to navigate through these tougher times," said Rick Meckler, a partner at Cherry Lane Investments, a family investment office in New Vernon, New Jersey.

Stocks have also rallied this week on investor speculation that the Federal Reserve may not need to be as aggressive with interest rate hikes as some had feared.

The Dow Jones Industrial Average rose 288.73 points, or 0.89%, to 32,818.36; the S&P 500 gained 56.97 points, or 1.40%, to 4,129.4; and the Nasdaq Composite added 222.07 points, or 1.83%, to 12,384.66.

In other earnings, Intel Corp shares fell after the company cut annual sales and profit forecasts and missed second-quarter estimates.

Of the 279 S&P 500 companies that have reported earnings so far, 77.8% have exceeded expectations.

Data showed U.S. consumer spending increased more than expected in June as Americans paid more for goods and services, with monthly inflation surging by the most since 2005.

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

The S&P 500 posted three new 52-week highs and 33 new lows; the Nasdaq Composite recorded 53 new highs and 70 new lows.