The most dangerous investment enemy is the one we face in the mirror. Our fear, greed (and sometimes a delusional sense that we can somehow see the future) affect solid investment plans. But smart investing has just three simple rules:

  1. Build a diversified portfolio of low-cost index funds.
  2. Rebalance once a year.
  3. Never speculate–and don’t let anyone speculate on your behalf.

That’s it. Follow these simple rules and, over your lifetime, you’ll beat the pants off most professional investors, after fees. But there’s a pesky little devil that likes to tempt us all. It wants us to gamble, to guess the market’s direction. It wants us to dance in the stock market casino.

Such temptations sometimes hit us when we’re making trading orders. We’re left with a choice. Should we place a market order or a limit order? When we place a market order, we’re accepting the current market price. The order gets filled. Then we walk away and get on with our day.

Limit orders are different. With a limit order, investors can enter the maximum price that they would like to pay. If, for example, the price of an ETF opened at $45 per share, and the investor placed a limit order for $43 a share, the order gets filled if the price hits $43. It sounds like a ticket for a Black Friday deal.

But downsides exist. If the ETF’s price doesn’t hit $43, the order won’t get filled. The following day, the price might go higher. A crazy chase might follow–like trying to catch an untrained dog that has just jumped a fence.

Placing limit orders can be a lot like gambling. It’s the kind of speculation that can cost investors money. In the August 2010 edition of The Journal of Finance, Juhani T. Linnainmaa published, “Do Limit Orders Alter Inferences about Investor Performance and Behavior?” The researcher found that investors who use market orders usually do better than investors who place limit orders.

But there’s a better way to place a limit order–and it could save you money. After all, ETF prices sometimes go bonkers. Dan Bortolotti is a financial journalist and Certified Financial Planner with PWL Capital. He also created the excellent blog and podcast at Canadian Couch Potato.

Bortolotti says investors shouldn’t place market orders. They should place limit orders instead. When buying, he says they should set a price that’s slightly higher than the market price. This doesn’t mean they’ll necessarily pay a higher-than-market price. If an ETF traded at $45 per share, and the investor placed a limit order to buy at $45.50, the trade would likely get filled at $45.50 or less.

When selling, he says investors should set a price that’s slightly lower than the market price.

For example, assume an investor was ready to rebalance their portfolio. They might own Guggenheim’s S&P 500 Equal Weight ETF (RSP). If such an investor placed a market order to sell shares on August 24, 2015, they could have been in for a shock. At one point during the day, it fell 43 percent.

Guggenheim’s S&P 500 Index Fell Hard During The Day

Guggenheim's S&P 500 Index Fell Hard During The Day

As you can see by the chart, it recovered about half an hour later. But a market order to sell could have cost investors plenty of cash if the ETF plunged right after they placed their market order. Instead, if the investor had placed a limit order to sell at 10 to 20 cents below the market price, they might not have sold at a massive discount.

Mysterious market moves are a bit like lightning strikes. Sometimes, they’re caused by a computer glitch. This was likely the case with a British investor who emailed me this month. One of his ETFs had tumbled into a canyon during a single trading day. It fell 90 percent. “My account dropped about $70,000,” he said. “I didn’t know what to do.”

Fortunately, his iShares UK Property ETF recovered by the end of the day. Such phantom-like plunges might become more common. There was the so-called Flash Crash in 2010. Plenty of ETFs fell further than the stocks they held. That shouldn’t happen. After the fact–as with this Forbes story­–people try to guess what caused the market dump.

But investors shouldn’t worry about short-term market moves or mid-day pricing glitches. Nobody sees them coming. We can, however, make sure phantom moves don’t hurt us when we trade. We can set limit orders. But we need to do it right–and for the right reason.

Andrew Hallam is a Digital Nomad. He’s the author of the bestseller, Millionaire Teacher and The Global Expatriate's Guide to Investing: From Millionaire Teacher to Millionaire Expat.