Dow posts 4th weekly gain as US stocks rebound from losses