Skip to content

Stop loss - Conditional

The Stop loss - Conditional module sets a stop loss (SL) when a condition becomes true, for example when the trend turns. The SL is set a distance below the current price and can trail the price. Many traders use it to capture profits the moment the price retraces.

Time → No SL yet Locked-in profit Entry price Trailing SL 1 Buy order 2 Precondition true SL = Bid − SL start distance 3 SL hit closed in profit
Stop loss - Conditional
  1. The order opens without an SL (see ‘1’ in the image).
  2. When the Precondition becomes true, the SL is set SL start distance below the current price (see ‘2’ in the image). Then it trails the price with every new high.
  3. When the price hits the SL, the order is closed (see ‘3’ in the image).

The SL of a buy order is set below the current price, not necessarily below the open price. So the order can be in profit when the SL is hit. For a sell order, everything is reversed: the SL is set above the current price.

  • Name: optional, tells this module apart from others of the same kind. See Name.
  • Enabled for: Buy orders, Sell orders or Buy and Sell orders. If buy and sell orders need a different condition, add this module once for buy orders and once for sell orders.
  • Precondition (optional): the condition that must be true before the SL is set. Until then the module is inactive. You build it like a signal: see Conditions. Without a precondition, the SL is set the moment the order opens.
  • SL start distance (pips): how far the SL is from the current price at the moment the Precondition becomes true: SL = current price (Bid / Ask) − SL start distance.
  • Trail step size: how much the SL moves for every pip of new profit above the order’s previous high. With 1 the SL moves 1 pip; with 2 it moves 2 pips. With 0 the SL doesn’t trail (see the tip below).
  • Trail minimum distance (pips): the SL never gets closer to the current price than this. Useful with a Trail step size above 1. With 0 or a negative value the SL can overtake the price, which closes the order before the price retraces.

MetaTrader is a registered trademark of MetaQuotes Ltd. EA Builder Pro is not affiliated with MetaQuotes.