Free Guide 0.4

Stop Loss, Take Profit and Order Types

An Expert Advisor (EA) opens and closes trades with orders, and it protects them with a stop loss and a take profit. How those work in MetaTrader 5 (MT5), and where they can let you down, decides how much a losing trade really costs. This page covers both.

Stop Loss and Take Profit

  • Stop loss: a price at which a losing position is closed, to limit the loss.
  • Take profit: a price at which a winning position is closed, to bank the profit.

When either is reached, MT5 closes the whole position. Which price counts depends on the direction:

Position Stop loss and take profit are checked against
Buy the Bid (the price you'd sell at to close it)
Sell the Ask (the price you'd buy at to close it)

So a sell can be stopped out by the spread widening, even if the chart (drawn from the Bid) never touched the stop.

A Stop Is a Limit, Not a Guarantee

A stop loss is meant to limit a loss to roughly its size. It doesn't guarantee it. When the price reaches the stop, the position is closed at the next price available. In a fast or gapping market, such as over a weekend or around big news, that price can be worse than the stop, so the real loss can be bigger. The close can also come late, or not at all.

That's why the loss at the stop is an estimate, never a ceiling.

Who Holds the Stop

  • A stop set with the broker (the stop loss on the position, which you see in MT5's Trade tab) sits on the broker's server. It works whether or not your computer is on.
  • A "virtual" or hidden stop is one the EA keeps to itself and closes the trade with when the price gets there. It only works while your terminal is running and connected, with the EA switched on and allowed to trade. Switch the EA off and it stops working. A basket or equity stop, which closes a group of trades together, is usually virtual too.
  • MT5's own trailing stop (right-click a position, Trailing Stop) runs in your terminal, not on the server. It only follows the price while the terminal is running.

If an EA's stop is virtual, its protection depends on the computer it runs on. That's one reason to decide where the EA will run, such as on a VPS, before going live.

Stops Level and Freeze Level

Brokers set two minimum distances for each symbol, shown in the Specification window in points:

  • Stops level: the minimum distance for a stop loss, take profit or pending order. A stop or target on an open buy is measured from the Bid, and on an open sell from the Ask. A buy pending order's price is measured from the Ask, and a sell's from the Bid. A pending order's own stop and target are measured from its order price (for a stop-limit order, check the trigger price and the limit price separately). A stops level of 0 means no minimum is set.
  • Freeze level: when the price is this close to a pending order or to a position's stop or target, they can't be changed.

An EA whose stop is tighter than the stops level will have its orders refused. MT5's Journal shows these as "invalid stops".

Order Types

Market orders buy or sell now, at the current price. How the price is agreed depends on the broker's execution type, shown in the Specification window:

  • Instant execution: at the price you see; if it has moved, the broker may offer a new price (a requote).
  • Request execution: at a price the broker quotes on request.
  • Market execution: at the price the broker fills it at, which can differ from the price you saw (slippage).
  • Exchange execution: at the prices on an external exchange.

Pending orders wait for a price. MT5 has six:

Order Opens a When
Buy Limit buy the Ask falls to the order price or lower
Sell Limit sell the Bid rises to the order price or higher
Buy Stop buy the Ask rises to the order price or higher
Sell Stop sell the Bid falls to the order price or lower
Buy Stop Limit Buy Limit order the Ask reaches the stop price
Sell Stop Limit Sell Limit order the Bid reaches the stop price

How Long Orders Last

An order can be set to last until cancelled, until the end of the trading day, or until a time or day you choose. Separately, each symbol has a rule for how long pending orders, stops and targets stay in place, shown in the Specification window:

  • Good till canceled: until you cancel them.
  • Good till today including SL/TP: pending orders, stops and targets are all deleted at the end of the trading day.
  • Good till today excluding SL/TP: pending orders are deleted at the end of the day; stops and targets stay.

On a symbol where stops are deleted each day, an EA that sets its stop once and leaves it would be left with no stop. Check this rule in the Specification window for every symbol the EA trades.

Filling Policy

When there isn't enough volume to fill an order at once, the filling policy decides what happens:

  • Fill or Kill: all of it, or nothing.
  • Immediate or Cancel: as much as is available now; the rest is cancelled.
  • Return: as much as is available now; the rest stays as an order.
  • Book or Cancel: the order may only wait in the order book; if it would fill straight away, it's cancelled (limit and stop-limit orders only).

Each symbol allows some of these and not others. An EA that asks for one the symbol doesn't allow has its orders refused.

MT5 details checked against MetaQuotes' MetaTrader 5 help and MQL5 reference, October 2026. Examples are illustrative; read your own broker's figures.

Trading involves risk. Only trade with money you can afford to lose. This page is educational and is not financial advice.

The Robotic Trader Logo

© 2026 The Robotic Trader. All rights reserved.