Stop-Limit Order
Definition
A stop-limit order combines a stop trigger price and a limit fill price. When the market reaches the stop price, a limit order is activated at the limit price. This protects against extreme slippage (the order won't fill worse than the limit) but risks no fill if price gaps past the limit. Different from a standard stop-loss, which becomes a market order on trigger.
In-depth: Stop-Limit Order
Stop-limit orders extend the basic stop-loss concept by adding a fill-price constraint. Where a standard stop-loss becomes a market order on trigger (filling at the best available price, potentially with significant slippage during fast markets), a stop-limit becomes a limit order on trigger (filling only at the limit price or better).
Mechanics: 1. Place stop-limit with stop price S and limit price L 2. Order remains pending while price is on the safe side of S 3. When market reaches S, the order activates as a limit order at price L 4. Order fills only if price is at L or better; if price moves past L without filling, the order remains pending (or expires per time-in-force)
For a buy stop-limit: stop S above current price, limit L typically slightly above S. Buy executes only when price reaches S AND can be filled at or below L.
For a sell stop-limit: stop S below current price, limit L typically slightly below S. Sell executes only when price reaches S AND can be filled at or above L.
Use cases in forex EAs:
1. Breakout entry with slippage protection: instead of a buy-stop at the breakout level (which fills at any price during fast breakout, often with 5-15 pip slippage), use a buy-stop-limit with stop at breakout level and limit at breakout + 3 pips. The EA accepts up to 3 pips slippage but rejects fills beyond that. Trade-off: may miss the fastest breakouts entirely.
2. Stop-loss with slippage cap (rare in retail forex): instead of a market stop-loss that may execute 10-20 pips below the stop level during a gap, a stop-limit caps the loss at the limit but risks no fill — the position may run far past the limit if price gaps through. This is generally NOT recommended for stop-losses because the protection is the worst case scenario; risking no fill defeats the purpose.
3. Take-profit with floor: a sell stop-limit at the take-profit level with limit slightly below ensures the profit-taking exit doesn't execute at a price worse than the limit. Trade-off: may miss the exit entirely if price gaps below the limit.
MetaTrader support: MT5 supports stop-limit orders (`ORDER_TYPE_BUY_STOP_LIMIT` and `ORDER_TYPE_SELL_STOP_LIMIT`); MT4 does not natively support stop-limit, requiring EA-level emulation (monitor for stop trigger, then place limit order on activation).
When NOT to use stop-limit: standard stop-losses for position protection should use the regular stop-loss (market on trigger), not stop-limit. The whole point of a stop-loss is to guarantee the position exits when reached; risking no fill negates the protection.