PipWardenStart free

What is a stop loss?

Definition A stop loss is an order attached to a position that closes it automatically when the price reaches a set level, to limit the loss on that trade.

A stop loss is an order that closes a position automatically when the price reaches a level you set, to limit the loss on that trade to roughly what you planned. It does not fix the exit price: when the market gaps or moves fast, the stop fills at the next available price, which can be worse than the level.

How a stop loss triggers in MT5

The MT5 help describes the order as one “used for minimizing losses if the security price moves the wrong direction”. Which price triggers it depends on the side of the trade, because a position closes at the opposite side of the bid and ask:

Position Closes at Stop loss checked against Placed
Buy (long) Bid Bid Below the bid
Sell (short) Ask Ask Above the ask

MT5 draws forex charts from the bid (MT5 help), so a short’s stop can trigger while the chart’s high stays below it. That case has its own post: why a stop loss is hit at the bid or ask.

A stop is a trigger, not a price

When the price reaches the stop, “the entire position is closed automatically” (MT5 help), at the next price available. Stop loss and take profit orders “are stored and executed on the broker’s server, and therefore do not depend on the performance of the trading platform” (MT5 help). That page says of stop orders in general that a triggered one “is executed at the price equal to the specified one or worse than that”. Across a weekend gap there are no prices between the close and the open, so the first quote after the open triggers the stop, and it fills there or worse.

The position size calculator does the first half of that sum; how to calculate lot size explains it. Slippage is the second half.

Setting and moving it in MT5

  • New order: press F9 and fill in the Stop Loss field.
  • Open position: in the Toolbox (Ctrl+T), Trade tab, right-click the position and choose Modify or delete (MT5 help). With trade levels shown on the chart, you can also drag the stop line.
  • Minimum distance: each symbol has a stops level, the “minimal indention in points from the current close price to place Stop orders” (MQL5 reference). A stop closer than that is rejected with error 10016, “Invalid stops in the request”.

Server stops and virtual stops

Some Expert Advisors keep the stop hidden and close the trade themselves when price gets there. That virtual stop lives inside the terminal. If the PC sleeps or the connection drops, nothing closes the trade. MT5’s own trailing stop has the same limit: it “will not work, unlike the above orders, if the platform is off” (MT5 help).

The common mistake

Treating the stop distance as the maximum loss. It is the planned loss. The other habit is moving the stop further away as price approaches it, which turns a planned loss into an open-ended one.

Stop losses in PipWarden

Every trade PipWarden opens gets a stop loss and a take profit held on your broker’s server, not a virtual stop. The stop is based on ATR, a measure of recent volatility, and the lot size comes from your risk per trade and that distance, using your broker’s tick value, capped by your maximum lot. If the stop would sit inside the broker’s stops level, the trade is skipped and logged as “Stop too close”.

Breakeven and trailing run in the EA inside MT5 and move the stop at the broker. If the terminal is off, they pause and the stop stays where it was last set. See how it works.

Frequently asked questions

Is a stop loss guaranteed?
No. A standard stop loss is a trigger, not a promised price. Once triggered, the position is closed at the next available price, which after a gap or in a fast market can be worse than the level. MT5’s help says the same of stop orders in general: they fill “at the price equal to the specified one or worse than that”.
Does my stop loss still work if MT5 is closed?
A stop loss set on the position, yes: MT5 stores it on the broker’s server. A “virtual” stop that an EA watches and closes itself, and MT5’s own trailing stop, only work while the terminal is running.
Why does MT5 say "Invalid stops"?
Error 10016, TRADE_RETCODE_INVALID_STOPS, means the stop in the request was not accepted. Common causes are a stop on the wrong side of the price (a buy’s stop must sit below the bid) or one closer than the symbol’s minimum distance, the stops level, in points.

Educational content, not financial advice. Forex and CFDs are traded on margin and are high risk: you can lose money, and more than your deposit with some brokers. Examples use made-up numbers and show no real results. Read the risk disclosure.