Skip to content

Free MT5 Expert Advisor

Trade Manager EA

MT5 trade manager for manual and EA positions: break-even at X R, one partial close at Y R and an ATR trailing stop, with symbol and magic 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 to break-even at 1 R, closes 50% of the volume once at 1.5 R and trails the rest by ATR from 2 R, for the positions selected by the filters.
Risk model
Opens no trades; only reduces risk on existing positions by moving stops toward profit and closing part of the volume

What it does

Trade Manager EA handles the routine parts of managing a trade so you do not have to watch the screen. It works on positions you open by hand, on positions opened by other EAs, or both, and applies three rules measured in R, the distance between entry and the initial stop-loss. It never opens a trade.

How it works

Every tick and every second, the EA loops through open positions from the last to the first and selects each by ticket. For each position that passes the symbol and magic filters:

  1. Initial risk (1 R) is read from the stop-loss of the order that opened the position. If that order had no stop, the current stop is used once one exists on the losing side. Positions without any stop are skipped with a one-time message.
  2. Break-even: when profit reaches 1 R, the stop moves to entry plus 10 points.
  3. Partial close: when profit reaches 1.5 R, 50% of the original volume is closed once. The volume is rounded down to the broker's step, and the remainder is kept at or above the minimum lot. A position that is already smaller than its original volume is treated as already reduced.
  4. Trailing: from 2 R, the stop follows price at 2.5 times ATR, only ever moving toward profit and only by at least 10 points at a time.

Stop changes respect the broker's stops and freeze levels.

How to use it

Attach it to any chart. To manage everything, choose "All symbols" and "All positions". To work alongside a specific EA, choose that EA's magic number. Leave the strategy EA's own break-even and trailing off when this tool manages the same trades, so the two do not compete.

Settings

InputDefaultWhat it changes
Symbols to manageChart symbolScope of symbols
Positions to manageAllManual, one magic, or both
Magic number filter0Magic used by the filter
Break-even at (R) / lock1.0 / 10 pointsBreak-even rule
Partial close at (R) / %1.5 / 50Partial close rule
Trail start (R)2.0When trailing begins
Trail distance (x ATR)2.5Trailing distance
ATR timeframe / periodchart / 14ATR source
Minimum stop step (points)10Avoids tiny modifications
Max slippage (points)20For partial closes

Limitations

R-based rules need a stop-loss; positions without one are not managed until a stop is added. Moving to break-even early can turn trades that would have worked into small exits. If the terminal is closed, nothing is managed, so a VPS or always-on computer is needed. Partial closes are not possible when the position is already at the minimum lot.

Before you run it live

Open small positions on a demo account and watch each rule trigger in the Experts log. In the Strategy Tester, run it together with test trades or on another EA's positions. Check that your broker allows partial closes on your account type. Our Risk-Reward Calculator helps you think in R. Trading carries a substantial risk of loss.

Key inputs

Key inputs of Trade Manager EA
InputDefaultDescription
Symbols to manageChart symbol onlyManage only the chart's symbol or every symbol.
Positions to manageAll positionsAll, manual only, one magic number, or manual plus one magic number.
Break-even at (R)1.0Profit, in multiples of the initial risk, that moves the stop to entry.
Partial close at (R)1.5Profit at which part of the position is closed once.
Partial close (%)50Share of the original volume to close.
Trail start (R)2.0Profit at which the ATR trailing stop starts.
Trail distance (x ATR)2.5Distance of the trailing stop from price.

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