Skip to content

Stop loss - Trailing

The Stop loss - Trailing module doesn’t set a stop loss (SL) right after an order opens. It waits until the order reaches a profit threshold, then sets the SL and moves it up with the price. Many traders use it to capture profits the moment the price retraces.

Time → No SL yet Locked-in profit Entry price Profit threshold Trailing SL 1 Buy order 2 Profit threshold reached 3 SL set SL = Entry + Trail start value SL hit closed in profit
Trailing stop loss. SL moves up when the price moves up. SL can go into profit.
  1. The order opens without an SL (see ‘1’ in the image).
  2. The price reaches the Profit threshold (see ‘2’ in the image).
  3. The SL is set at the open price + Trail start value, and moves up as the order makes new highs (see ‘3’ in the image).
  4. When the price hits the SL, the module closes the order.

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.

  • Name: optional, tells this module apart from others of the same kind. See Name.
  • Profit threshold (pips): the profit an order must reach before the SL is set and starts trailing. Before that, the module has no effect. Example: with 30, the SL is set when the order has 30 pips of profit.
  • Trail start value: where the SL starts, in pips from the open price: SL = open price + Trail start value. With -20 the SL is set at 20 pips of loss, with 0 at break-even, with 20 at 20 pips of profit.
  • Trail step size: how much the SL moves for every pip of new profit. With 1 the SL moves 1 pip per pip of profit; with 2 it moves 2 pips.
  • 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.

Your settings are: Profit threshold 30 pips, Trail start value 20 pips, Trail step size 1.

  • At 30 pips of profit the SL is set at 20 pips of profit: 10 pips behind the price, and it stays 10 pips behind.
  • With a Trail step size of 10, one more pip of profit moves the SL to 31 − 20 + (10 × 1) = 30: only 1 pip behind the price.
  • From then on the Trail minimum distance (pips) keeps the distance: with 1 the SL stays 1 pip behind, with 0.1 it stays 0.1 pip behind.

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