Sub topic 11
Stop-Market and Stop-Limit Orders
Assume you understand trading pairs, order books, and basic Python. A stop order is an order that stays inactive until a chosen trigger price is reached. Traders use stop orders to limit losses, protect profits, or enter a position after a breakout.
How a stop order triggers
A stop order has two important prices:
- The stop price is the trigger that activates the order.
- The execution price is the price at which the activated order actually trades.
The exchange may trigger the order using the last traded price, mark price, or index price. These rules differ by exchange, so check the exchange documentation before relying on a stop order.
Stop-market orders: prioritize execution
A stop-market order becomes a market order when its stop price is reached. It usually provides a high chance of execution, but it does not guarantee a particular price.
Suppose you own 1 BTC bought at $60,000. You place a sell stop-market order with a stop price of $57,000. If the trigger condition is met, the exchange submits a market sell order. The order consumes available bids, possibly at $56,950, $56,800, or lower.
This difference between the stop price and the actual fill price is slippage. It becomes more likely when the order book is thin, the market moves quickly, or the market gaps between prices.
A buy stop-market order works in the opposite direction. It can enter a position when price rises through a breakout level. For example, a buy stop at $65,000 activates when the trigger condition is met and then buys from the available asks.
Stop-limit orders: prioritize price
A stop-limit order becomes a limit order after its stop price is reached. It has both a stop price and a limit price.
For a protective sell order, you might set:
- Stop price: $57,000
- Limit price: $56,800
When the trigger occurs, the exchange places a sell limit order at $56,800. The order can fill at $56,800 or a higher price, but it will not sell below $56,800.
This protects the minimum acceptable price, but execution is uncertain. If the market falls directly from $57,000 to $56,500, no buyer may accept the limit price. The order remains open or expires according to its settings, while your position continues losing value.
| Order | After triggering | Main benefit | Main risk |
|---|---|---|---|
| Stop-market | Market order | Higher execution certainty | Uncertain fill price |
| Stop-limit | Limit order | Price control | May not fill |
Common failure modes and safeguards
A stop order is not a guaranteed exit. Watch for these problems:
- Trigger mismatch: The exchange uses mark price, but you watched the last traded price.
- Price gap: The market jumps past your stop before the order can execute.
- Thin liquidity: A market order moves through several bid or ask levels.
- Stop-limit non-fill: The market moves beyond the limit price.
- Wrong direction or quantity: A fat-fingered order can create or close a position unexpectedly.
- Leverage liquidation: A leveraged position may be liquidated before your stop executes.
Use a smaller position, verify the trigger source, and check the estimated liquidation price before placing a stop. Test the exchange's order preview in a low-risk setting if available.
def stop_limit_sell(triggered, stop_price, limit_price, bids):
"""Return fills for a triggered sell stop-limit order."""
if not triggered:
return [], 0.0
fills = []
remaining = 1.0
for price, size in bids:
if price < limit_price:
break
take = min(remaining, size)
fills.append((price, take))
remaining -= take
if remaining == 0:
break
return fills, remaining
bids = [(57_000, 0.3), (56_900, 0.4), (56_700, 1.0)]
print(stop_limit_sell(True, 57_000, 56_800, bids))
# ([(57000, 0.3), (56900, 0.4)], 0.3)The remaining 0.3 BTC did not fill because the next bid was below the $56,800 limit.
Exercise
Which order is more appropriate when exiting is more important than controlling the exact price: a stop-market or stop-limit order?
Show answer
A stop-market order, because it becomes a market order and is more likely to execute, although its fill price can be worse than the stop price.