Category
Strategy
Difficulty
Intermediate
Used in
Strategy designMT5 operationRisk management

Trailing stop

A trailing stop is a stop-loss that moves in the direction of a profitable trade and never moves back. It turns an open gain into a floor under the position, so a retracement decides the exit instead of a target chosen in advance.

also: trailing stop-loss, dynamic stop, trail

Updated · Reviewed

In plain English

A stop that follows price up but never follows it back down. It gives a winning trade room to run, and sets the exit at a level the trade has already passed. Like any stop it is only a trigger, so a gap can still close it worse.

Why it matters

A fixed target has to be chosen before anyone knows how far the move will go. A trail replaces that guess with a rule: stay in until the market takes back a defined amount. What that rule is worth depends on how uneven a strategy's winners are.

  • It removes the need to predict the size of a move — the prediction fixed targets are worst at.
  • It ratchets one way only. A trail that could loosen would move a stop away from price, and that breaks the risk calculation behind the position.
  • Its value is strategy-specific. Across the 24 published records measured here, capping every winner at that record's own median winner keeps 98.16% of gross profit on one and 1.27% on another.

In MetaTrader 5

Where it appears in MT5

  • Toolbox → Trade → right-click a position → Trailing Stop — the terminal's own feature, offered as point presets plus a custom value
  • ⚠ That trail runs in the terminal, not on the server. Close MetaTrader and it stops moving, though the last level it wrote stays in force
  • Strategy Tester → Inputs — an EA's trail distance and activation threshold are inputs, and the pair is easy to overfit

How EAs use it

  • On each pass the EA builds a candidate stop from current price, and sends it only when it beats the stop in force.
  • Many builds wait for an activation threshold, often one stop distance of profit, so the first tick in favour cannot drag the stop to break-even.
  • Trailing on closed bars instead of every tick cuts modification volume sharply and usually changes the result very little.

Typical settings

Setting Typical value Note
Trail distance (ATR) 2–3 × ATR(14) Below roughly 1.5 × ATR the trail sits inside ordinary retracement and closes trends early.
Activation threshold after 1 × the stop distance in profit Stops the trail pulling to break-even before the trade has done anything.
Step (minimum improvement) 5–10 pips Without a step the EA modifies on nearly every tick, which brokers throttle.
Update frequency once per closed bar Tick-by-tick trailing multiplies request volume and rarely improves outcomes.

Common operational problems

  • Modifications sent too often get rejected or throttled, and the trail then lags price silently.
  • A trail distance shorter than the symbol's stops level is refused every time it is sent, so the stop never advances at all.
  • Gaps jump a trailing stop the way they jump a fixed one. The level is a trigger, not a promise about the fill.

Related MT5 functions

CTrade::PositionModify(ticket, sl, tp)
The call every trailing step goes through — one modification per step.
PositionGetDouble(POSITION_SL)
The stop in force, which the candidate has to beat before anything is sent.
SymbolInfoInteger(symbol, SYMBOL_TRADE_FREEZE_LEVEL)
Inside this distance a position cannot be modified at all.

Example

A long entered at 1.0800 with a 20-pip trail. The stop follows the high-water mark and never retreats, so the retracement picks the exit.

Entry
1.0800
Price advances to
1.0850
Stop moves to 1.0830.
Price advances to
1.0880
Stop moves to 1.0860, and will not move back.
Price retraces, trade closes at
1.0860
60 pips out of an 80-pip excursion.

A fixed 40-pip target would have finished at 1.0840. Different bets on how far moves run.

Calculation 1.0880 − 20 pips = 1.0860

Result 60 pips kept, 20 given back — the cost of not predicting the top

How it is used

A trail sits between two costs. Too tight and trends end early; too loose and much of the move goes back. The distance is the whole decision.

Range What it means
Trail under about 1.5 × ATR Ordinary retracement closes the position, so the strategy never sees the large moves.
Trail at 2–3 × ATR The usual working range for trend strategies: outside the noise, close enough to protect most of a move.
Trail wider than the move so far The stop is still behind entry, so the whole open profit can be handed back before anything triggers.
Trailing from the first tick, no threshold Drags the stop to break-even at once and turns normal fluctuation into scratch trades.
  • Measure how uneven your winners are before arguing about distance. If the largest tenth carries little more than its proportional tenth of gross profit, the trail has almost nothing to protect.
  • Validate the trail out of sample on its own. Distance and activation threshold together leave room to fit noise.

Whether a listed EA trails its exits or takes a fixed target is stated in its strategy description, and the published ledger shows what the exits realised. Every measured figure on this page comes from those ledgers (EXP-EXIT-SHAPE-001), closed-trade basis.

Common mistakes

Trailing so tightly that no trend survives

A trail inside ordinary retracement turns a trend strategy into a scalper wearing a trend strategy's entry rules. The win rate rises, the average win collapses, and for a strategy that depends on its largest winners the expectancy usually goes with it.

Believing a trailing stop protects against gaps

It is a trigger price like any other stop. A weekend or news gap through the level closes the position at the next available price.

Copying a trail distance from a strategy with a different win distribution

The 24 records measured here keep between 1.27% and 98.16% of gross profit when their winners are capped at their own median winner. One rule, opposite consequences.

Optimising the trail distance to the best backtest value

That distance is fitted to one history's retracements. A value surviving across neighbouring settings is worth more than the peak of a narrow spike.

In depth

Setting one in MT5, and what stops when the terminal does

MetaTrader’s own trailing stop is a terminal feature, not an order the broker holds for you.

  1. Open Toolbox → Trade, right-click the position, choose Trailing Stop.
  2. Take a point preset, or Custom to type a distance. None switches it off again.
  3. Each step is a real modification, so the symbol’s stops level and freeze level both still apply.
  4. Leave the terminal running. Close MetaTrader and the last stop it wrote stays in force on the server, while the trail stops advancing.

Step 4 is the failure that looks like success. The position still carries a stop, the chart still shows a line, and nothing reports an error. An EA’s own trailing code has the same dependency.

What 24 published ledgers show about exit shape

Each listing carries its closed-trade list, so the distance of every exit and the money it produced can both be read directly — 17,357 trades in all.

Measure (24 records, 17,357 closed trades)MedianRange or count
Exits closing against entry: distances inside ±2% of that symbol’s median83.78%above 50% on 17 of 24
Exits closing in favour: the same band26.30%above 50% on 7 of 24
Largest tenth of winners’ share of gross profit25.64%11.85% to 34.08%
Largest single winner’s share of gross profit1.17%up to 4.89%
Gross profit kept if winners are capped at the median winner62.83%1.27% to 98.16%
The same, capped at twice the median winner84.76%

The two distance rows are not symmetric, and the asymmetry runs one way. No record repeats its winning distance without also repeating its losing one, while ten do the reverse: a fixed stop with a winning side that lands anywhere. The tail is also thinner than trend folklore suggests. The largest single winner reaches at most 4.89% of a record’s gross profit, so the gross profit here is spread across many winners rather than resting on one.

That shape can be checked against what each listing says it does. Six records declare a trailing exit in their published strategy description, and all six land in the dispersed group — their winning distances cluster a median 2.06%, the highest is 38.35%, and none reaches 50%. The other eighteen sit at a median of 35.03%, seven of them above 50%.

Measure the unevenness of the winners first, then pick a distance. Average true range supplies the scale, volatility says whether that scale still matches the one the settings were tuned in, and parameter optimisation covers the neighbouring-values check a trail distance has to survive.

Frequently asked questions

What is a good trailing stop distance for an EA?
For trend strategies, two to three times ATR is the usual working range: outside ordinary retracement, close enough to protect most of a move. Under about 1.5 times ATR the trail closes trades during normal fluctuation and removes the extended trends the strategy exists to capture.
Does a trailing stop work when MetaTrader is closed?
The stop level already in place does, because it sits on the broker's server. The trailing itself does not: the terminal's built-in trail and an EA's trailing code both need the terminal running to send the next modification. That is why unattended EAs are hosted on a VPS.
Is a trailing stop better than a fixed take-profit?
Only for strategies whose winners have no natural exit level. Trend following benefits, because the size of the move cannot be known in advance. Mean-reversion usually does not: price is expected back at a specific level, and holding past it gives the gain back.
Why does my trailing stop stop moving?
Usually the stop has come within the broker's minimum distance from price, or the position sits inside the freeze level where modifications are refused. Throttled requests look the same from outside — the trail lags rather than stopping.
How do I tell whether a trail is worth adding at all?
Sort the winning trades by size and check what the largest tenth contributes to gross profit. On the 24 records measured here that tenth carries a median 25.64%, roughly two and a half times the share an evenly sized set of winners would give it. Close to its own even share, the winners are already uniform and there is little tail to protect.