There are a few things that need to be addressed here - strategy, technical setup, and anomalies.
First, let's discuss the strategy of setting stop losses. You need to make sure you set your stop losses at the right prices. There are a few ways to choose these stop loss areas. You can choose a maximum risk on a trade (i.e. stop out at a 5% loss), but I prefer to set a stop at a price area where the trade/investment thesis is proven wrong. For example, if you expect a stock to bounce off of its 200-day moving average, you could set a stop slightly below the 200SMA since your trade thesis would be nullified if that price area didn't hold as support. It's important to give yourself some wiggle room since support areas are not exact prices. This is where a lot of people go wrong. They may set a stop at $50 only to see the stock hit $49.66 before rallying. If your stops are too tight, you may trigger false positives. If they are too liberal, they don't fulfill their purpose. Find the proper balance.
Next, you need to set up the stop itself. We'll call this the technical setup. You have a few options.
- First, you can set a "mental stop." This is your mental risk level where you plan to exit the trade, however you do not place an open order. If you use these types of stops, you need to be able to keep an eye on your stocks. You also need to trust yourself to actually follow through on your risk management plan.
- You can set a basic stop order. This is a stop order that converts into a market order when your stop price is triggered. The benefit of this order is that it almost guarantees that your order gets executed. The downside is that you have less control over the price your order is executed at. For example, a stop at $50 could trigger a sell at $49.80 in steady market conditions or at $48 in highly volatile conditions.
- Lastly, and my personal preference, you can set a stop limit order. This is a stop order that converts into a limit order when the stop price is triggered. For example, you could set a stop for $50 with a limit at $49. I usually keep the limit price very close to the stop price, but you can be more liberal if you're trading a volatile stock. For example, a $49 limit may be appropriate on a stock that has been fluctuating between $48-$53 over the past few weeks, whereas a $45 limit may be more appropriate for a stock trading in a $40-$60 range.
In general, the stop limit order is the best because you can control risk while still maintaining control over your sell price. That said, you may run the risk of not getting your order filled, which leads to the last point.
The situations you are referring to in the question represent anomalies. Let's assume you have a stop limit order set at $50 with a $48 limit. The chances that this stock triggers the stop and drops to $40 without filling your limit order are very slim. First of all, that type of volatility is rare (i.e. dropping from $50 to $40 in a few seconds). Second, in that type of event, the stock usually triggers a bunch of orders as it declines. It's rare that one order goes off at $50 and the next order goes off at $40. Usually the stock will hit a bunch of numbers in between (i.e. $49, $48, $47, etc.). In order for the stock to jump from $50 to $40, it would have to be highly illiquid, which is something you would be able to notice before you entered a position (by analyzing the volume and/or intraday charts).
There's no stop loss formula that works 100% of the time. We've all been frustrated by some of our stop loss orders that are triggered right before the stock rallies back. It's just part of the game. If you assign too much weight to the anomalies, you will mess up your stop loss strategy.