I accumulated a large position in JD.com (JD -0.49%), China's largest direct retailer, throughout 2018. I remained bullish on JD over the past three years, even as the stock was rocked by a scandal involving its CEO But I recently sold my entire stake for an average gain of roughly 74%, for four main reasons.

1. Too many regulatory headwinds

JD is still growing like a weed. Its revenue rose 29% in 2020 and grew 32% year over year in the first half of 2021, and the company ended the second quarter with 531.9 million annual active customers.

JD.com CEO Richard Liu.

Image source: JD.com.

However, JD remains exposed to China's escalating crackdown on its top tech companies. JD hasn't been hit by a sweeping antitrust probe like Alibaba (BABA 0.12%) yet, but China's State Administration of Market Regulation (SAMR) has still fined JD several times over the past year for its pricing strategies, advertising tactics, and other undisclosed violations of China's antitrust laws.

China's new data privacy law could change how JD collects its employee and customer data, while proposed changes to the country's e-commerce laws could curb the growth of its smaller third-party marketplace with stiffer penalties for counterfeit products and IP violations.

Regulators in China and the U.S. are also scrutinizing the variable interest entity (VIE) structure, which lets Chinese companies list shares of overseas holding companies on U.S. exchanges. China's regulators have considered closing that loophole entirely, while American regulators plan to delist all shares of Chinese companies that don't comply with tighter auditing rules within the next three years.

All those regulatory headwinds make JD a much riskier investment than other high-growth e-commerce stocks. JD might still be a safer bet than Alibaba because it faces fewer fines and restrictions, but it won't attract more investors until China and the U.S. clarify their future plans for Chinese ADRs.

2. I own too many e-commerce stocks

In addition to JD, I also own shares of Amazon (AMZN -2.87%), MercadoLibre (MELI -1.46%), Sea Limited (SE -2.22%), and Coupang (CPNG -0.85%) as long-term e-commerce plays. Amazon isn't growing as quickly as JD, but the global diversification of its retail marketplace and AWS' (Amazon Web Services) higher-margin revenue arguably make it a more balanced investment than JD.

Meanwhile, MercadoLibre, Sea's Shopee, and Coupang are all growing much faster than JD, and they lead the Latin American, Southeast Asian, and South Korean e-commerce markets, respectively. None of those growing companies face the same degree of regulatory scrutiny as JD.

Dropping JD from my e-commerce basket enables me to focus on the winners while reducing my overall exposure to the sector -- which will broadly face tougher comparisons as the pandemic passes.

3. I'm not optimistic about China's future

At the beginning of 2021, Chinese tech stocks accounted for a fifth of my portfolio. But I reduced that percentage throughout the year, and selling JD finally reduced my direct exposure to China to zero.

I gradually sold all of my Chinese stocks for three reasons: China's economic growth was slowing, its trade and tech wars with the U.S. were intensifying, and China clearly wanted to rein in its top tech companies. Over the past few months, the Evergrande debt crisis also sparked concerns about a meltdown across China's real estate and financial sectors.

These challenges, along with the delisting threats, indicate it's smarter to step back from the Chinese market -- regardless of how cheap the top stocks might seem relative to their growth potential.

4. Raising more cash for better stocks

Lastly, I'd like to have enough cash on hand to buy more stocks if the market crashes. Even after selling JD and a few other stocks, cash still only accounts for about 3% of my portfolio.

Over the next few weeks, I plan to sell other weaker stocks to boost that percentage to 5% or more so I can buy more shares of winning stocks when the market pulls back.

Should you also sell your shares of JD?

I still admire JD as a company, and I believe it could continue growing. But I think it's simply too risky as an investment, especially for U.S. investors who only have access to its ADR shares instead of its newly issued shares in Hong Kong. There are plenty of other great e-commerce stocks to choose from, and I believe it will be smarter to stick with them and avoid Chinese ones like JD and Alibaba for now.