Gabby Douglas and her teammates on the Olympic gold medal-winning U.S. women's gymnastics team rang the closing bell Tuesday. By then, the major averages had turned slightly lower in late day trading.

The Dow closed at 13,210 points, gaining 41 points on the day. The Nasdaq added nine points, climbing to 3,031. After Monday's losses snapping a six-day winning streak, the S&P edged up four points to close at 1,408.

Stocks had been higher in early and midday trading Tuesday on signs that Americans are spending again. Retail sales rose a solid eight-tenths of a percent in July, after three straight months of declines. The largest uptick in retail sales in five months was spurred by more spending on cars, furniture and clothing.