The S&P 500 has ended nearly flat despite coming close again to its record closing high as data on the US economy added to uncertainty over the recovery.

Aggressive stimulus measures have helped the three main US stock indexes bounce back from a coronavirus-driven crash in March.

The benchmark index at one point on Friday was up 0.15 per cent to 3,378.51 but retreated to close very marginally lower.

On Wednesday and Thursday, the S&P 500 briefly traded above its February 19 record close of 3,386.15 but lacked momentum on Friday.

“New all-time highs are like rusty doors and require several attempts before they finally break open,” said Sam Stovall, chief investment strategist at CFRA Research in New York.

“So, approaching, but not breaking through, is actually standard,” and a few more attempts may still be ahead before the record is broken, he said.

Hitting a closing record would confirm, according to a widely accepted definition, that the S&P 500 entered a new bull market after hitting its pandemic low on March 23.

Investors also may be pausing after the market’s big advance, with plenty of uncertainty to keep them cautious.

“There’s still a lot of uncertainty with regard to the overall economy, as well as the increase in case count that we’ve seen over the past month or so,” said Brian Price, head of investments for Commonwealth Financial Network.

Data on Friday showed US retail sales increased less than expected last month and could slow further due to spiralling COVID-19 cases and a reduction in unemployment benefit cheques.

Separately, readings showed that US factory output increased more than expected in July but remained below pre-pandemic levels while consumer sentiment was largely steady in the first half of August.

The Dow Jones Industrial Average rose 34.3 points, or 0.12 per cent, to 27,931.02, the S&P 500 lost 0.58 points, or 0.02 per cent, to 3,372.85 and the Nasdaq Composite dropped 23.20 points, or 0.21 per cent, to 11,019.30.

For the week, the S&P 500 rose 0.6 per cent, the Dow added 1.8 per cent and the Nasdaq gained 0.1 per cent.

Adding to recent uncertainty, prospects of more fiscal aid have faded with the Senate and House of Representatives in recess and no fresh talks scheduled.

The upcoming US presidential election is adding caution, along with continued outbreaks of the virus in parts of the United States.

Applied Materials Inc gained 3.9 per cent after it forecast fourth-quarter revenue above analysts’ estimates following a rebound in demand for chip equipment and services.

Shares of German biotechnology firm CureVac BV surged in their Nasdaq debut, marking the first stock market launch by a company developing a potential vaccine for the novel coronavirus.

Declining issues outnumbered advancing ones on the NYSE by a 1.06-to-1 ratio; on Nasdaq, a 1.14-to-1 ratio favoured decliners.

The S&P 500 posted 16 new 52-week highs and no new lows; the Nasdaq Composite recorded 49 new highs and 14 new lows.

Volume on US exchanges was 7.83 billion shares, compared with the 10.1 billion average for the full session over the last 20 trading days.