Trailing stop manager with break even manager
- Utilità
- Minh Vuong Pham
- Versione: 1.0
Advanced Multi-Mode Trailing Stop for MetaTrader 5
What Is It?
Trailing Stop Manager automatically moves your Stop Loss to protect profits as price moves in your favor. Unlike MT5's built-in trailing stop (which only has one mode), this EA offers 4 professional trailing methods that adapt to different trading styles and market conditions.
Works on ALL symbols. Attach to any chart and it manages all matching positions.
4 Trailing Modes
1. Fixed Pips Trailing
The classic trailing stop. Once price moves X pips in profit, the SL follows at a fixed distance behind price.
- TrailStartPips = 20 → trailing begins after 20 pips profit
- TrailDistancePips = 15 → SL stays 15 pips behind current price
- Best for: trending markets with steady momentum
2. ATR-Based Trailing
Uses the Average True Range indicator to dynamically adjust trailing distance based on market volatility. In volatile markets, the trail is wider; in calm markets, it's tighter.
- ATR_Period = 14, ATR_Multiplier = 1.5
- Trail distance = ATR value × multiplier
- Best for: adapting to changing volatility (Gold, Indices, News events)
3. Step Trailing
Moves SL in discrete steps rather than continuously. SL only advances when price reaches the next step level, reducing the chance of being stopped out by normal price fluctuations.
- StepSize = 20 → SL moves every 20 pips of profit
- StepDistance = 15 → SL sits 15 pips below each step level
- Example: Entry at 1.1000, SL moves to 1.1005 at +20p, 1.1025 at +40p, 1.1045 at +60p
- Best for: reducing noise, holding trades through pullbacks
4. Breakeven + Trail (Two-Phase)
Phase 1: Moves SL to breakeven (+ lock pips) once minimum profit is reached. Phase 2: Starts trailing after a larger profit threshold.
- BE_TriggerPips = 15 → breakeven at +15 pips
- BE_LockPips = 2 → lock +2 pips above entry (guaranteed small profit)
- BE_TrailStartPips = 30 → trailing begins at +30 pips
- BE_TrailDistancePips = 15 → trail distance after breakeven
- Best for: securing entry first, then letting winners run
Key Features
- 4 trailing modes in one EA — switch via input parameters
- Order filters: Manage All, Buy Only, or Sell Only
- Magic Number filter: Manage only specific EA's orders (0 = all)
- Smart SL logic: Never moves SL backwards — only in the protective direction
- SL validation: Checks that new SL is valid before modification
- Real-time chart display: Shows managed positions, mode, and Net P/L
- Auto-detect filling mode: Works with any broker (FOK/IOC/Return)
- Minimize chart clutter: Clean comment display, no extra indicators needed
Input Parameters
General
| Parameter | Description |
|---|---|
| TrailMode | Fixed Pips / ATR / Step / Breakeven+Trail |
| ManageMode | All Orders / Buy Only / Sell Only |
| MagicNumber | Filter by EA (0 = manage all) |
| ShowComment | Display info on chart |
Fixed Pips
| TrailStartPips | Min profit to start trailing (default: 20) | | TrailDistancePips | SL distance behind price (default: 15) |
ATR-Based
| ATR_Timeframe | ATR calculation timeframe (default: H1) | | ATR_Period | ATR period (default: 14) | | ATR_Multiplier | Distance = ATR × this (default: 1.5) | | ATR_StartPips | Min profit before ATR trail (default: 10) |
Step Trailing
| StepSize | Step interval in pips (default: 20) | | StepDistance | SL offset from step level (default: 15) |
Breakeven + Trail
| BE_TriggerPips | Profit to activate breakeven (default: 15) | | BE_LockPips | Lock pips above entry (default: 2) | | BE_TrailStartPips | Profit to start trailing (default: 30) | | BE_TrailDistancePips | Trail distance (default: 15) |
Installation
- Copy TrailingStop_Manager_v1.mq5 → MQL5/Experts/
- Restart MT5 or refresh Navigator
- Drag onto chart → configure Inputs → OK
- Ensure AutoTrading is enabled
Recommended Combinations
| Situation | Recommended Mode |
|---|---|
| Scalping (5-20 pips) | Fixed Pips (start: 5, distance: 3) |
| Gold / volatile pairs | ATR-Based (multiplier: 1.5-2.0) |
| Swing trading | Step (step: 50, distance: 30) |
| Any style (safe default) | Breakeven + Trail |
Combine with Collective TP Manager for collective profit targets and Daily P/L Limiter for account protection.
SL modifications are logged in MT5 Experts tab. Always test on demo first.
