Break-even and Trailing Stop Manager
Info
The Break-even and Trailing Stop Manager is a Expert Advisor for MetaTrader 5 that attach this tool to a chart to manage the stop loss for existing positions, whether they are manual trades or opened by another expert advisor. Break-even Functionality:- Automatically moves the Stop Loss to the entry price plus a specified locked profit (in points) once the trade reaches a predefined profit target (in points).
Usage
This tool is typically used for automated trading on major forex pairs and gold.
Platform
This Expert Advisor works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Experts folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Break-even and Trailing Stop Manager
1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.
2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.
3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.
4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.
Frequently Asked Questions
Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.
Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.
Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.
What this tool does
Attach this tool to a chart to manage the stop loss for existing positions, whether they are manual trades or opened by another Expert Advisor.
Typical Use Case
This Expert Advisor excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Expert Advisor works on MetaTrader 5. Place the file in the MQL5/Experts folder and restart the terminal.
Description & Settings
Related: Break-Even and Trailing Stop Manager for Open Positions - another powerful expert for MetaTrader 5 traders.
Attach this tool to a chart to manage the stop loss for existing positions, whether they are manual trades or opened by another Expert Advisor.Also recommended: Gaussian Auto EA: Trend Following with ATR-Scaled Bands and Trailing Stop - similar expert with strong performance on MetaTrader 5.
Break-even Functionality:
- Automatically moves the Stop Loss to the entry price plus a specified locked profit (in points) once the trade reaches a predefined profit target (in points).
Trailing Stop Functionality:
- Maintains a fixed distance in points from the price, or trails using an Average True Range (ATR) multiple. The ATR period and timeframe are selectable, and the value from the last closed bar is used to prevent erratic adjustments within a bar.
- The trailing stop activation can be set to trigger only after a trade has achieved a specified profit in points.
Safety and Broker Compliance:
- The Stop Loss will only move in a forward direction and will not be moved backward. It also adheres to a minimum SL step to reduce modification requests to the broker.
- The tool respects the broker's minimum stop level and freeze level requirements.
- Modifications are not sent when the symbol's trading session is closed (e.g., daily breaks or weekends).
- If a Stop Loss modification request is rejected by the broker, the affected trade ticket is temporarily paused for a set duration to prevent excessive logging and server load.
- Existing Take Profit levels on trades are preserved.
Filtering Options:
- Manage trades for the current chart symbol only, or for all symbols on the account.
- Filter trades by Magic Number: -1 for all trades, 0 for manual trades, or a specific EA's Magic Number.
Tested on XAUUSD and EURUSD (M5 timeframe) for 2 months in the Strategy Tester, involving thousands of stop loss modifications without any instances of stops being moved backward. This tool was developed and tested in 2026.
You may also like: Channel Breakout EA with ATR Trailing Stop and Risk Percentage Sizing - excellent alternative for expert users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
enum TRAIL_MODE
{
TRAIL_OFF = 0,
TRAIL_POINTS = 1,
TRAIL_ATR = 2
};
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.