The Dow Jones Industrial Average gained 516 points on Thursday as markets were on track to break weeks-long losing streaks.