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 points) the trade must be before trailing starts. Example: trailing_activate: 300 means the trailing stop only kicks in after the trade is 300 points (30 pips) in profit.

Trail distance — How far behind the current price the SL follows. Example: trailing_distance: 150 means the SL stays 150 points (15 pips) behind the best price reached.

{
  "alert_name": "alertX",
  "magic": 1001,
  "symbol": "EURUSD",
  "action": "BUY",
  "volume": 0.1,
  "sl": 400,
  "tp": 1200,
  "trailing_activate": 300,
  "trailing_distance": 150
}

This trade starts with a 400-point (40-pip) SL. Once 300 points in profit, the SL starts trailing 150 points behind price. All TP/SL/trailing values are in points — 5-digit broker: 10 points = 1 pip.

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 points of profit before breakeven triggers. Example: move_sl_after: 500 means breakeven activates at 500 points (50 pips) profit.

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

{
  "alert_name": "alertX",
  "magic": 2001,
  "symbol": "XAUUSD",
  "action": "SELL",
  "volume": 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).

{
  "alert_name": "alertX",
  "magic": 3001,
  "symbol": "GBPJPY",
  "action": "BUY",
  "volume": 0.1,
  "sl": 600,
  "tp": 2000,
  "move_sl_after": 400,
  "move_sl_to": 50,
  "trailing_activate": 800,
  "trailing_distance": 300
}

Timeline of this trade (point values; 5-digit broker so 10 points = 1 pip): 1. Entry at market price, SL is 600 points (60 pips) below 2. At +400 points → SL moves to entry + 50 points (breakeven) 3. At +800 points → trailing activates, SL now 500 points above entry 4. At +1200 points → SL trails to 900 points above entry 5. Either TP hits at +2000 points, 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:

{
  "alert_name": "alertX",
  "magic": 4001,
  "symbol": "EURUSD",
  "action": "BUY",
  "volume": 0.2,
  "sl": 500,
  "move_sl_after": 300,
  "move_sl_to": 30,
  "partial_tp": "0.05=400,0.05=800,0.05=1200",
  "trailing_activate": 600,
  "trailing_distance": 250
}

What happens (point values; 500 points = 50 pips on 5-digit broker): 1. Open 0.20 lots BUY with 500-point SL 2. At +300 points → breakeven (SL to entry + 30) 3. At +400 points → close 0.05 lots, lock in profit 4. At +600 points → trailing starts on remaining 0.15 lots 5. At +800 points → close another 0.05 lots 6. At +1200 points → 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
trailing_activate: 15
trailing_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
trailing_activate: 40-60
trailing_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
trailing_activate: 100-150
trailing_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
trailing_activate: 100
trailing_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.