Opening a trade is the easy part. Managing it — knowing when to tighten your stop, when to take profit, when to let it run — that's where most traders struggle. And it's exactly where automation shines.

An MT5 Expert Advisor can manage your open positions with trailing stops and breakeven logic that executes without hesitation, without emotion, and without you watching the screen.

What is a Trailing Stop?

A trailing stop is a stop loss that moves in your favor as price moves in your favor, but never moves against you.

Example: You buy EURUSD at 1.1000 with a 30-pip SL (at 1.0970). - Price moves to 1.1050 → SL trails up to 1.1020 - Price moves to 1.1080 → SL trails up to 1.1050 - Price pulls back to 1.1050 → trade closes at 1.1050 for +50 pips profit

Without the trailing stop, you'd have either: - Hit your fixed TP and left money on the table, or - Watched the trade reverse all the way back to your SL

Trailing Stop Parameters

Two key settings control trailing behavior:

Activation distance — How far in profit (in pips) the trade must be before trailing starts. Example: trail_activate: 30 means the trailing stop only kicks in after the trade is 30 pips in profit.

Trail distance — How far behind the current price the SL follows. Example: trail_distance: 15 means the SL stays 15 pips behind the best price reached.

{
  "action": "alertX",
  "symbol": "EURUSD",
  "magic": 1001,
  "direction": "BUY",
  "size": 0.1,
  "sl": 40,
  "tp": 120,
  "trail_activate": 30,
  "trail_distance": 15
}

This trade starts with a 40-pip SL. Once 30 pips in profit, the SL starts trailing 15 pips behind price.

What is Breakeven?

Breakeven moves your stop loss to your entry price (or entry + a small offset) after the trade reaches a certain profit level. The goal: eliminate the possibility of a winning trade turning into a loser.

Example: You buy XAUUSD at 3100 with a 100-pip SL (at 3000). - Price moves to 3150 (50 pips profit) → breakeven triggers - SL moves from 3000 to 3105 (entry + 5 pip buffer) - Now the worst outcome is a +5 pip gain instead of a -100 pip loss

Breakeven Parameters

Move SL after — How many pips of profit before breakeven triggers. Example: move_sl_after: 50 means breakeven activates at 50 pips profit.

Move SL to — Where to place the SL relative to entry price. Example: move_sl_to: 5 means SL moves to entry + 5 pips. This small buffer covers the spread so you don't get stopped out at exactly breakeven.

{
  "action": "alertX",
  "symbol": "XAUUSD",
  "magic": 2001,
  "direction": "SELL",
  "size": 0.05,
  "sl": 150,
  "tp": 300,
  "move_sl_after": 80,
  "move_sl_to": 10
}

Combining Trailing Stop + Breakeven

The most effective approach uses both together:

  1. Breakeven first — After 50 pips profit, move SL to entry + 5 pips (risk eliminated)
  2. Trailing stop later — After 80 pips profit, start trailing SL 30 pips behind price

This way you get early protection (breakeven) and then progressive profit locking (trailing).

{
  "action": "alertX",
  "symbol": "GBPJPY",
  "magic": 3001,
  "direction": "BUY",
  "size": 0.1,
  "sl": 60,
  "tp": 200,
  "move_sl_after": 40,
  "move_sl_to": 5,
  "trail_activate": 80,
  "trail_distance": 30
}

Timeline of this trade: 1. Entry at market price, SL is 60 pips below 2. At +40 pips → SL moves to entry + 5 pips (breakeven) 3. At +80 pips → trailing activates, SL now 50 pips above entry 4. At +120 pips → SL trails to 90 pips above entry 5. Either TP hits at +200 pips, or trailing stop catches a reversal

Adding Partial Take Profit

For even more sophisticated management, combine trailing and breakeven with partial take profit (partial TP). Close portions of your position at different levels:

{
  "action": "alertX",
  "symbol": "EURUSD",
  "magic": 4001,
  "direction": "BUY",
  "size": 0.2,
  "sl": 50,
  "move_sl_after": 30,
  "move_sl_to": 3,
  "partial_tp": "0.05=40,0.05=80,0.05=120",
  "trail_activate": 60,
  "trail_distance": 25
}

What happens: 1. Open 0.20 lots BUY with 50-pip SL 2. At +30 pips → breakeven (SL to entry + 3) 3. At +40 pips → close 0.05 lots, lock in profit 4. At +60 pips → trailing starts on remaining 0.15 lots 5. At +80 pips → close another 0.05 lots 6. At +120 pips → close another 0.05 lots 7. Remaining 0.05 lots runs with trailing stop until reversal

This approach locks in guaranteed profit at multiple levels while still capturing large moves with the trailing portion.

Best Settings by Strategy Type

Scalping (5M-15M)

sl: 15-25 pips
move_sl_after: 10-15
move_sl_to: 2
trail_activate: 15
trail_distance: 8

Tight stops, fast breakeven, close trailing. Get in, protect, get out.

Day Trading (15M-1H)

sl: 30-50 pips
move_sl_after: 25-35
move_sl_to: 5
trail_activate: 40-60
trail_distance: 20

Medium stops, moderate breakeven. Let trades develop but protect early.

Swing Trading (4H-Daily)

sl: 80-150 pips
move_sl_after: 60-100
move_sl_to: 10
trail_activate: 100-150
trail_distance: 50-80

Wide stops, patient breakeven. Give trades room to breathe.

Gold (XAUUSD)

sl: 100-200 pips
move_sl_after: 60-100
move_sl_to: 10
trail_activate: 100
trail_distance: 50

Gold moves fast — wider stops prevent premature exits, but breakeven protects capital early.

Common Mistakes

Trailing too tight — If your trail distance is smaller than the typical pullback, you'll get stopped out on normal retracements. The trailing distance should be larger than the average pullback on your timeframe.

Breakeven too early — Moving to breakeven at +10 pips on a 4H swing trade means you'll get stopped out by noise. Match your breakeven level to the strategy's timeframe.

No buffer on breakeven — Setting move_sl_to: 0 places your SL exactly at entry. With spread, you'll often close at a small loss. Always add a small buffer (2-10 pips depending on the pair).

Conflicting TP and trailing — If your TP is at 60 pips and your trailing activates at 80 pips, the trailing stop will never activate because TP closes the trade first. Make sure trailing activates before your TP level if you want to use both.

FAQ

Does the trailing stop work when I'm offline? Yes. The trailing logic runs inside the MT5 EA on your VPS. It doesn't depend on TradingView or the signal server — once the trade is open, the EA manages it locally.

Can I change trailing settings on an open trade? The trailing parameters are set when the trade opens. To change behavior on future trades, update your alert message. Existing trades continue with their original settings.

Does breakeven trigger a notification? If Telegram notifications are enabled, you'll receive a message when breakeven activates — including the symbol, direction, new SL level, and current profit.


Automate your risk management with iNakaTrader. Trailing stop, breakeven, and 4-level partial TP — all executed by the EA. View plans.

Risk Disclaimer: Trading forex and other financial instruments involves substantial risk of loss and is not suitable for all investors. Past performance does not guarantee future results. Only trade with capital you can afford to lose. iNakaTrader provides signal execution tools, not financial advice.