Skip to content

Stop loss - Catching up trail

The Stop loss - Catching up trail module sets a trailing stop loss (SL) that catches up with the price as the profit grows. From Gain0 the distance between the price and the SL decreases; from Gain1 the SL trails the price at the Trail minimum distance. Use it to give a trade room at first and protect more of the profit later.

  1. When the order reaches the Profit threshold, the SL is set Offset pips below the current price, and trails it.
  2. From Gain0 pips of profit, every new high moves the SL closer to the price.
  3. From Gain1 pips of profit, the SL trails the price at the Trail minimum distance.
  4. The SL only moves on a new high. When the profit falls back to the SL, the order closes.
  • Name: optional, tells this module apart from others of the same kind. See Name.
  • Profit threshold (pips): when the module activates. With 0 it activates when the order opens and sets the SL at the Offset distance; with 10 it activates when the order has 10 pips of profit. Use a positive value.
  • Offset (pips): the initial distance of the trailing SL: current price − Offset. Use a positive value.
  • Gain0 (pips): from this profit the SL starts to decrease the trailing distance. Use a positive value, greater than or equal to the Profit threshold.
  • Gain1 (pips): at this profit the SL is at the Trail minimum distance from the current price. Set it bigger than Gain0 for a gradually increasing gain.
  • Trail minimum distance (pips): from Gain1 onward, the SL trails the price at this distance. With 0 or a negative value the SL overtakes the price, which closes the order.

Both examples use: Profit threshold = 0, Offset = 10, Gain0 = 15, Gain1 = 25 and Trail minimum distance = 1.

Profit (pips) -100102030 Time → Entry price Offset Trailing SL 1 Buy order Distance = Offset 2 Gain 0 SL catches up 3 Gain 1 Minimum distance 4 SL hit closed in profit
What the module does with a profit that rises in a straight line. Not realistic, but it shows the effect of each setting.
Profit (pips) -100102030 Time → Entry price Offset Trailing SL 1 Buy order Distance = Offset 2 Gain 0 SL catches up 3 Gain 1 Minimum distance 4 SL hit closed in profit
The same settings with a volatile profit. From Gain0 (15 pips of profit) the SL rises faster, and it stays at its highest value when the order isn't making new highs.

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