Breakeven Plus Trail Combo
Breakeven-stop EAs and trailing-stop EAs are both common on their own, and traders often run one of each on the same chart to get both behaviours. That combination has a known failure mode: a breakeven EA that re-checks its own trigger on every tick can find its condition still numerically true after a trailing EA has already moved the stop well past breakeven, and drag it backward to the breakeven level - undoing real trailing progress because the two EAs have no idea the other one exists. This EA avoids that by tracking a single stage per position instead of two independent conditions. Profit reaching InpBreakevenTriggerPips moves the stop to entry plus InpBreakevenBufferPips. Profit reaching the later InpTrailStartPips switches the position permanently into trailing mode - after that point the breakeven logic can never touch that ticket again, so there is no path back to a worse stop once trailing has begun. The trailing stage itself only ever moves the stop forward, the same one-directional rule used throughout this catalogue's trailing-stop programs. This EA manages an existing position only. It never opens one - attach it after entering by hand or alongside another EA that opens trades under the same magic number. Notes and limitations - Tracks one position per InpMagicNumber per chart symbol. A new ticket under the same magic resets the stage back to waiting. - If InpTrailStartPips equals InpBreakevenTriggerPips, the position moves to breakeven and straight into trailing on the same tick - a valid but aggressive configuration; widen the gap between the two for a genuine breakeven pause first. - Both stages respect the broker's minimum stop distance (MODE_STOPLEVEL/ SYMBOL_TRADE_STOPS_LEVEL and MODE_FREEZELEVEL/SYMBOL_TRADE_FREEZE_LEVEL); a move that would land inside it is skipped and logged rather than rejected by the trade server. - Does not run this EA alongside a separate breakeven or trailing-stop EA on the same position - the whole point of combining the two here is to avoid that exact conflict.
Expert advisor · MT5 · v1.0 · Free
About Breakeven Plus Trail Combo
Breakeven Plus Trail Combo is an expert advisor (trading robot) for MetaTrader 5. It moves the stop loss behind price (trailing stop / break-even) and has a news filter. It has 8 settings, such as Magic number, Breakeven trigger pips and Breakeven buffer pips. MQL source code included.
Files in the download: BreakevenTrailCombo.ex5, BreakevenTrailCombo.mq5, BreakevenTrailCombo.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Magic number | 20260517 | Magic number of the position to manage |
| Breakeven trigger pips | 20 | Profit distance required before the stop moves to breakeven |
| Breakeven buffer pips | 2.0 | Pips beyond entry kept as the breakeven floor |
| Trail start pips | 40 | Profit distance required before trailing begins |
| Trail distance pips | 25 | Distance kept behind price once trailing is active |
| Min adjust pips | 1.0 | Minimum improvement before modifying the stop again |
| Max retries | 5 | Attempts per modification before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Experts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: Trailing Stop & Break-even · News Trading · MT5 Expert Advisor · MQL5 Source Code