There’s a simple lesson for us do-it-yourself retail investors in the foul-up Monday that affected 341 of the exchange-traded funds that are bought and sold on the NYSE Arca Equities market.

The lesson is this: Even though ETFs have the word “fund” in their name, they actually trade like stocks rather than like regular open-end mutual funds. And that turned out to be a problem when a misbehaving software upgrade hindered certain closing auctions at the end of the trading day, causing confusion among traders.

The exchange eventually sorted everything out by shifting to backup systems. But you can protect yourself from possible glitches by using “limit orders” rather than “market orders” when you buy or sell ETFs, the same way you should protect yourself when you buy or sell stocks.

You buy a regular mutual fund by sending money to Vanguard or Fidelity or Black Rock or some other fund company, which determines share prices after the market closes and tells you how many shares your money has bought. When you sell, the fund company sends you money based on your shares’ net asset value.

But when you buy or sell an ETF, you’re not dealing with a fund company. You’re buying from a market participant or selling to one at the price prevailing the instant that you do the transaction, which takes place when the financial markets are open.

The NYSE said Tuesday that Monday’s problem has been fixed and that trading was proceeding normally. But there’s no reason that you should take the slightest chance of being hurt by trading glitches, which can feed on themselves because so much trading these days is computer-to-computer with no human intervention until after problems strike.

Here’s how to protect yourself. Instead of submitting your ETF trade at the market price, place a limit order. You do this by checking the “limit order” box on whatever brokerage site you’re using, and you set a specific price as the most you’re willing to pay (if you’re buying) or the least you’re willing to accept (if you’re selling).

I generally pick numbers 2 or 3 percent above the current market when I buy, and 2 or 3 percent below market when I sell.

It takes a few seconds more to place a limit order than to place a market order. But it doesn’t affect the price you pay to trade, and it protects you against market hiccups. I call it “hiccup insurance,” and all it costs you is a few seconds of your time. And not a penny of premiums.

Monday’s NYSE glitch was nowhere near as damaging as the flash crashes or other market seizures that we’ve had in recent years. But it’s another example of why I take out hiccup insurance by placing limit orders when I buy or sell stocks or ETFs. And why you should do that, too.