Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

TrailGuard - break-even and trailing stop manager for open trades - expert for MetaTrader 5

Archie Stuart Clarke
Archie Stuart Clarke
I build and fix MT5 Expert Advisors and indicators in MQL5.
Every job is tested in the MT5 Strategy Tester before delivery, and you get a short plain-English note of what was built and how it was checked. Ask for a backtest report and you get the honest numbers, good or bad.
Views:
34
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

TrailGuard is an Expert Advisor for MetaTrader 5 that looks after the stop loss on trades that are already open. Once a trade is a set distance in profit (150 points by default) it moves the stop to the entry price plus a small locked profit (10 points). After that it can trail the stop behind price in one of two ways: a fixed distance (200 points), or a distance based on how much the market has been moving (1.5 times the 14-bar ATR on H1). Trailing starts once the trade is 300 points in profit.

It is for anyone who places trades by hand, or runs another EA, and wants the stop managed for them. It can look after this chart's symbol only or every symbol, and every trade, manual trades only, or one EA's trades by magic number. It manages trades that are already open, so the chart's timeframe does not matter. It was tested on EURUSD H1.

What it does not do: on a live or demo chart it never opens a trade and never closes one. It only moves the stop, and only in the trade's favour, never backwards. It follows the broker's own rule on how close a stop may sit to price, and it only moves a stop when the move is at least 20 points, so it does not pester the broker. If the broker refuses a change, it waits 60 seconds before trying that trade again.

A small panel on the chart shows the settings, how many trades it is looking after, how many stops it has moved and the last thing it did. Testing: Strategy Tester, EURUSD H1, 1 October to 20 November 2026. 221 stop moves on 53 trades, 0 refused by the broker, 0 moved backwards. Not tested on netting accounts. In the Strategy Tester only, it can open small practice trades so there is something to manage. That switch does nothing on a real chart.

Inputs (defaults):

  • Break-even trigger, points (0 = off): 150
  • Locked profit, points: 10
  • Trailing mode: off / fixed points / ATR
  • Trailing starts at profit, points: 300
  • Trailing distance, points (fixed mode): 200
  • ATR multiple (ATR mode): 1.5
  • ATR period: 14
  • ATR timeframe: H1
  • Minimum step to move the stop, points: 20
  • Positions to manage: this symbol / all symbols
  • Magic filter: -1 = any, 0 = manual trades only, a number = that robot only
  • Status panel on the chart: on / off
  • Strategy Tester only, open demo positions to manage: on / off
VolumeProfile_POC_Zones VolumeProfile_POC_Zones

Dynamic Volume Profile indicator for MetaTrader 5 displaying horizontal volume distribution, Point of Control (POC), and Value Area (VAH/VAL) zones. Includes a layout switcher to anchor the histogram on either the right or left side of the lookback range.

EzoO Close All - close all, profitable, losing, buy or sell positions in one click EzoO Close All - close all, profitable, losing, buy or sell positions in one click

Script that closes positions in one click: all, only profitable, only losing, only buys or only sells, for this symbol or all symbols, with a magic filter and optional pending order delete.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.