Skip to content

Free MT5 Expert Advisor

Trailing Stop Manager EA

MT5 trailing stop manager with five modes: fixed points, ATR, Chandelier, previous candle low or high, and latest swing point, with filters.

Risk managementv1.0MetaTrader 5 (MQL5) Compiles with 0 errors Non-repainting signals Stop-loss on every trade
Strategy
Does not open trades. Moves the stop of each selected position behind price using the chosen trailing mode, and only ever in the direction of profit.
Risk model
Opens no trades; only tightens stops on existing positions

What it does

Trailing Stop Manager EA follows your open trades with a stop that moves as price moves in your favour. You pick one of five well-known trailing methods, and the EA applies it to the positions selected by the symbol and magic filters. The stop never moves backwards, and the EA never opens or closes a trade itself; exits happen when price reaches the stop.

How it works

Every tick and every second, the EA loops through positions from last to first, selected by ticket. Once profit reaches the start threshold, it calculates a candidate stop. For buys:

  • Fixed: bid minus the set number of points.
  • ATR: bid minus ATR × multiple.
  • Chandelier: highest high of the last 22 closed bars minus 3 × ATR.
  • Previous candle: lowest low of the last N closed candles, minus an optional buffer.
  • Swing: the most recent swing low below price (a low lower than the bars on each side), minus the buffer.

Sells use the mirror image (ask plus distance, lowest low plus ATR, highs instead of lows). The candidate is applied only if it is better than the current stop by at least the minimum step, respects the broker's stops and freeze levels, and stays on the correct side of price. A position without a stop receives one from the first valid candidate.

How to use it

ATR and Chandelier modes adapt to volatility and suit trend-following trades on H1 and above. Candle mode is tight and suits short-term momentum trades. Swing mode keeps the stop behind market structure and gives trades more room. Set a start threshold if you do not want the stop moved before the trade is in profit. Use a higher timeframe setting than your chart for a looser trail.

Settings

InputDefaultWhat it changes
Trailing modeATRMethod used
TimeframechartSource of bars and ATR
Start after (points)0Activation profit
Minimum step (points)10Avoids tiny modifications
Buffer (points)0Extra room in candle and swing modes
Fixed distance (points)200Fixed mode
ATR period / multiple14 / 2.0ATR mode
Chandelier bars / multiple22 / 3.0Chandelier mode
Candle bars1Candle mode
Swing strength / lookback2 / 60Swing mode
Symbols / PositionsChart / AllScope

Limitations

Every trailing method trades off protection against room: tight trails exit early in normal pullbacks, loose trails give back more profit. Stops are server-side only after the EA modifies them, so nothing updates while the terminal is off. Gaps can fill beyond the stop. Do not run two trailing tools on the same positions.

Before you run it live

Try each mode on a demo account or in the Strategy Tester alongside a strategy EA, and compare how far behind price each one sits. Check your broker's stops level, especially on gold and indices. Our stop-loss lesson covers the basics. Trading carries a substantial risk of loss.

Key inputs

Key inputs of Trailing Stop Manager EA
InputDefaultDescription
Trailing modeATR multipleFixed points, ATR, Chandelier, previous candle(s) or latest swing.
TimeframeChart timeframeTimeframe used for ATR, candles and swings.
Start after (points)0Profit needed before trailing begins.
ATR distance (x ATR)2.0Distance from price in ATR mode.
Chandelier bars / multiple22 / 3.0Lookback for the extreme and ATR multiple in Chandelier mode.
Swing strength2Bars on each side for a swing in swing mode.
Minimum step (points)10Smallest stop improvement that is sent to the broker.

Educational tools, not advice. Automated trading can lose money quickly. Indicators and Expert Advisors describe price; they do not predict it, and past behaviour does not guarantee future results. Test everything on a demo account first and never risk money you cannot afford to lose. See our disclaimer.

Keep exploring

Related mt5 expert advisors