Gains in financial, materials and industrial companies outweighed losses in health care and real estate stocks as investors reviewed the latest batch of company earnings reports and awaited signs of progress in the latest round of U.S.-China trade talks.
The S&P 500 index gained 4.94 points, or 0.2 percent, to 2,784.70.
The Dow Jones Industrial Average added 63.12 points, or 0.2 percent, to 25,954.44.
The Nasdaq composite rose 2.30 points, or 0.03 percent, to 7,489.07.
The Russell 2000 index of smaller companies picked up 7.19 points, or 0.5 percent, to 1,581.66.
For the week:
The S&P 500 is up 9.10 points, or 0.3 percent.
The Dow is up 71.19 points, or 0.3 percent.
The Nasdaq is up 16.66 points, or 0.2 percent.
The Russell 2000 is up 12.41 points, or 0.8 percent.
For the year:
The S&P 500 is up 277.85 points, or 11.1 percent.
The Dow is up 2,626.98 points, or 11.3 percent.
The Nasdaq is up 853.79 points, or 12.9 percent.
The Russell 2000 is up 233.10 points, or 17.3 percent.