Image source: Getty Images.

Investing in stocks is a terrific way to build a lot of wealth. Over the long run, stocks have historically outperformed bonds, Treasury bills, real estate, and gold -- significantly. Still, the stock market is not without some dangers, and it can burn you. Here are three ways to lose all your money in the stock market.

Image source: Pixabay.

Penny stocks

A classic newbie mistake in the stock market is to invest in penny stocks. They're ones that trade for less than about $5 per share and are usually tied to unproven, volatile companies. Worse, they're often easily manipulated due to their having relatively few shares outstanding.

Consider the pump-and-dump maneuver: Someone buys lots of shares a penny stock while they're very cheap and then starts hyping the company in newsletters, online, and elsewhere. Naive investors will be excited and will start buying shares, sending the price up. Then the hypester will sell his shares at the inflated prices, reaping profits. As he sells, the price will fall, leaving the scammed folks with losses.

You can steer clear of penny stocks by avoiding companies with very low share prices -- no matter how you love the idea of being able to own, say, 2,000 shares of a company for only a $500 investment. Remember that a $0.25 stock can still plunge and become a $0.05 one. And a $200 stock can always grow into a $400 one. Don't read too much into a stock price.

Beware of compelling stories, too -- when the story is just about all there is. Penny stocks are often hyped with an enticing story: This company is close to curing cancer! That company is on the verge of a massive gold or oil discovery!

Day trading is more gambling than investing. Image source: Pixabay.

Day trading

Another danger in the stock market is day trading. Day traders will typically buy and sell shares of companies they know little to nothing about, often basing decisions solely on charts of share price movements. They may hold the shares for just a few hours or minutes, and while their gains on each share might be small, they hope to make big bucks through volume. Of course, this isn't really investing -- it's speculating and gambling, and lots of stocks won't act as you expect them to over the very short term.

Day trading can be costly in other ways, too. Since day traders will often place dozens or even hundreds of trades in a single day, they face steep commission costs from those trades. And any gains they reap will face short-term capital gains taxes, which are the same as their ordinary income tax rates -- 25% or 28% for most folks and even more for high earners. According to an academic study of frequent traders by Brad Barber and Terrance Odean, the most active traders reaped the lowest returns. Indeed, between 1992 and 2006, fully 80% of active traders lost money and "only 1% of them could be called predictably profitable."

Even the Securities and Exchange Commission (SEC) has warned against day trading, saying such things as: "Be prepared to suffer severe financial losses. Day traders typically suffer severe financial losses in their first months of trading, and many never graduate to profit-making status." "Day trading is an extremely stressful and expensive full-time job." "Don't believe claims of easy profits."

Image source: Pixabay.

Shorting stocks

Finally, another way to lose a lot of money in stocks is to short them. "Shorting" a stock involves betting against it. The typical way to invest is to establish a "long" position in a stock, where you buy shares and hold them, expecting them to increase in value. You plan to sell the shares later at a profit.

Shorting, though, reverses that. It's weird but legal and practiced by plenty of investors. Instead of buying low and selling high, shorting involves aiming to first sell high and then buy low.

Imagine, for example, that you think shares of Home Surgery Kits (Ticker: OUCHH) are overvalued and likely to fall. To short the stock, you would have your broker borrow shares from someone else's account and then sell them. The idea is that later, when the shares have fallen, you can buy them on the open market for less and replace them. If they fall as expected, then you'll profit, as you hoped to.

But stocks don't always behave as expected. If you're long a stock and it falls from $50 per share to $0, you can lose all your money. If you're short a $50 stock, though, and it triples in value, you will have to replace the borrowed shares at some point and pay much more than the $50 you pocketed when you shorted it. When you're long a stock, your downside is capped at 100%. When you short a stock, the downside can easily exceed 100%. Also, remember that while you bet against a company, you'll have its management working against your interests, trying to increase its value.

For the best results investing in stocks, take the time to learn more about investing -- and don't stop learning. The savvier you are, the bigger your gains could be.