NEW YORK ( TheStreet) -- U.S. stocks posted their first gains of the week on Thursday as investors cheered China's stronger-than-expected trade numbers for both exports and imports. The S&P 500 rose 0.39% to close at 1,697.48 while the Dow Jones Industrial Average added 0.18%, to 15,498.32. The Nasdaq climbed 0.41% to close at 3,669.12. Data revealed Chinese exports rose 5.1% in July, which was up from a 3.1% decline in June. "It's the market largely ending where the futures were after China announced the import/export data," said Michael Gayed, chief investment strategist at Pension Partners LLC. "It's simply follow through." In company news, JC Penney ( JCP) was one of the top performers on the S&P after activist billionaire investor Bill Ackman increased pressure on the company to find a new chief executive to replace current head, Myron Ullman. Shares of the department store added 6.7% to $13.66. The Labor Department said Thursday that initial jobless claims for the week ended Aug. 3 rose to 333,000, up 5,000 from the prior week's revised print but below what economists polled by Thomson Reuters anticipated. The four-week moving average dipped to 335,500, which was near its lowest level since the recession began in late 2007. Despite the upbeat data from jobless claims's moving average, Neil Hennessy, chief investment officer of Hennessy Funds, said companies are still making moves that aren't helping cut the unemployment rate. Those moves include initiating dividends, raising dividends, buying back stock, investing in internal infrastructure or making acquisitions. "Now, that is all good for the stock market, really good for the stock market going forward, but it's not good for unemployment," said Hennessy. "People are still very fearful of March of 2009; it's still at the front of their brains , they don't believe this rally is long term. So any time you get a rally and investors start to look, they say, 'Well, OK, I'm up or I'm back to even, I'm getting out.'" Also adding to improving investor sentiment may be growing belief among traders that the Federal Reserve won't scale back its monetary stimulus as early as expected. "The probability of September is almost out just given that it's still a weak market," said Alfonso Esparza, senior currency analyst at OANDA. Shares of Tesla Motors ( TSLA) surged 14.3% to $153.48 after the electric car maker posted second-quarter earnings that exceeded analysts' expectations. The company reported earnings of 5 cents a share on revenue of $405 million, while analysts were looking for a loss of 17 cents on revenue of $383.4 million. Shares of Groupon ( GRPN) soared 21.7% to $10.61 after the board named Eric Lefkofsky as its chief executive and after the company reported earnings of 2 cents a share on revenue of $608.7 million, which slightly beat expectations. Groupon cited strong mobile purchases among North American users in the quarter. Newmont Mining ( NEM) was one of the top gainers on the S&P as the gold mining company was riding a boost in gold prices on Thursday. Shares jumped 8.7% to $28.78. "You got the dollar index down ... that's definitely going to help out the metals, and it's helping, actually, most of the commodities across the board," said Phil Streible, senior commodities broker at RJO Futures. CenturyLink ( CTL) fell 5.6% to $34.36 after the company said it expects a profit of 59 cent to 64 cents a share on $4.5 billion to $4.55 billion in revenue. These numbers were slightly softer against a consensus among analysts polled by Thomson Reuters looking for 65 cents a share on $4.52 billion in revenue.