Stocks appeared headed for a third decline in three days for much of Wednesday. But by late afternoon, the market began to pare its losses as investors bought up stocks of oil refiners, mining companies, and tech firms. The Dow closed lower, but the buying nudged up the Nasdaq and S&P 500. The three indexes are still down for the week, though, following last week’s records. Investors have been worried about a drop in China’s exports in February. A dearth of major US economic news dampened trading Wednesday, leaving the market listless. That may change Thursday as data on retail sales and jobless benefit applications are released.