Trailing Stop and Break-Even Manager (Points or ATR)
Info
The Trailing Stop and Break-Even Manager (Points or ATR) is a Expert Advisor for MetaTrader 5 that this utility manages the stop loss for open positions, regardless of how they were opened. It does not initiate or close trades; it solely adjusts stop losses in a profitable direction.
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 Trailing Stop and Break-Even Manager (Points or ATR)
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
This utility manages the stop loss for open positions, regardless of how they were opened.
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: Risk Lot Calculator: Determine Lot Size from Risk Percentage and Stop Distance - another powerful expert for MetaTrader 5 traders.
This utility manages the stop loss for open positions, regardless of how they were opened. It does not initiate or close trades; it solely adjusts stop losses in a profitable direction.Also recommended: Advanced Trailing Stop Manager for MT4/MT5 - similar expert with strong performance on MetaTrader 5.
Functionality
Break-even: Once a position reaches a specified profit level (in points), the stop loss is moved to the entry price plus a defined locked profit.
Trailing Stop: After a secondary profit threshold is met, the stop loss will trail the market price at a fixed point distance or a multiple of the Average True Range (ATR).
The stop loss is never moved backward. Adjustments are only made when they improve the stop loss position by at least the minimum step, and the broker's minimum stop distance rule is always respected.
Settings
Break-even trigger and locked profit (points; trigger 0 disables this feature)
Trailing mode: Disabled, Fixed Points, or ATR Multiple
Trailing start distance, trailing distance, ATR multiple, ATR period, and ATR timeframe
Minimum step required to move the stop loss
Applicable positions: Current chart's symbol or all symbols
Magic number filter: -1 for any, 0 for manual trades only
On-chart status panel
Usage Instructions
Attach this tool to any chart and ensure Algo Trading is enabled. It monitors open positions every second and on every price tick. If a stop loss modification is rejected by the broker (e.g., due to market closure), the tool will retry the adjustment after a 60-second interval.
Please test this tool on a demo account before using it on a live account.
This is not financial advice. Past performance is not indicative of future results.
You may also like: Breakeven and R-Trail Manager: R-Multiple Trailing and Break-even at +1R - excellent alternative for expert users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#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"
#include <Trade\Trade.mqh>
enum ENUM_SCOPE
{
SCOPE_ALL_SYMBOLS = 0,
SCOPE_THIS_SYMBOL = 1
};
enum ENUM_TRAIL_MODE
.......
⚠ 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.