LadderGuard Trade Manager and Account Guard MT5
- Utilities
-
Ibrahim Yahya
I build MetaTrader 5 tools that follow your rules exactly: Expert Advisors, trade managers and trade copiers that size every trade from your risk and manage it to the end, unattended on a VPS.
What I have built and run: - Version: 1.0
- Activations: 5
LadderGuard is a trade manager and account guard for MetaTrader 5. You attach it to one chart, and it looks after the positions you already have, whether you opened them by hand or another Expert Advisor did. It does not open trades and it does not generate signals. It takes partial profits at the targets, moves the stop to break-even, then moves it up level by level. It also watches the whole account and locks trading when a daily loss or drawdown limit is hit.
What it does
Trade manager
- You choose the positions. Every position, manual trades only, or one EA's magic number. Every symbol, or only the chart's symbol.
- Targets from your stop. R is the distance from the entry to the stop loss. TP1 is at 1R, TP2 at 2R, and the last target at 3R or at the position's own take-profit if that is further away. All three are inputs.
- Partial profits. 40% of the original volume closes at TP1 and 30% at TP2. The rest rides to the last target. Volumes are rounded down to the broker's volume step, and a partial close that would break the broker's minimum volume is skipped.
- Break-even and ladder. At TP1 the stop moves to the entry plus a few points. After that, each time a new level is reached the stop moves up to the previous level. The EA never widens a stop.
- Close on time. Optional close-all of the managed positions (and their pending orders) at a server time you set, for example before the daily rollover.
- Panel buttons. Break-even all, Close 50%, Close all (with a confirmation) and Guard OFF, right on the chart.
- Levels on the chart. TP1, TP2 and LAST are drawn as dotted lines for the positions on the chart's symbol.
Account guard (always the whole account)
- Daily loss limit. A percentage of the day-start balance, a fixed amount in the account currency, or both (the smaller one wins). Closed and floating losses both count. When the limit is hit, every position is closed, every pending order is deleted, and trading stays locked until the next trading day: anything opened while locked is closed at once.
- Maximum drawdown. Measured from the equity peak, or static from the starting balance as many prop firms count it. A breach closes everything and locks until you press Unlock on the panel.
- Trades per day. A cap on new positions per day. Anything opened beyond it is closed at once until the day ends.
- Warnings. At 80% of a limit the panel bar turns red and you get one alert (and a push notification if push is set up in the terminal).
Panel
Balance, equity, today's P/L, the daily-loss and drawdown bars, trades today, the managed positions with their stage (waiting TP1, TP1 done with the stop at break-even, TP2 done, ladder level), the active rules, and the buttons. The panel can be minimised.
How to use it
- Attach LadderGuard to one chart (any symbol, any timeframe). Attach it once: one copy manages all the positions you select.
- Allow Algo Trading in the terminal and in the EA's settings. If Algo Trading is off, the panel says so and the manager pauses.
- Set which positions it manages (all, manual only, or one magic number) and your targets and percentages.
- Set the guard limits you want, or 0 to switch a limit off.
- Trade as usual. Give your positions a stop loss: R is measured from it. A position without a stop uses a fixed R in points (300 by default) and gets no stop from the EA unless you ask for it.
- Keep the terminal running (a VPS is ideal). TP1 and TP2 are kept by the EA, not placed at the broker, so they only work while the EA runs. The levels are saved, so after a restart it continues where it was.
In the Strategy Tester, LadderGuard opens small demo trades on the tested symbol (alternating BUY and SELL, stop at 2 x ATR(14), sized to about 1% of the balance at the stop), so that you can see the management at work in visual mode. This happens only in the tester and can be switched off. On a live or demo account it never opens a trade of its own.
Inputs
| Input | Default | What it does |
| Which positions | ||
| Manage only this chart's symbol | false | false = positions on every symbol |
| Magic: -1 all, 0 manual trades only, N one EA | -1 | Which positions to manage |
| Targets (R = the stop distance) | ||
| TP1 at R x | 1.0 | First target, in multiples of R |
| TP2 at R x | 2.0 | Second target |
| LAST at R x (when the position's own TP is not beyond TP2) | 3.0 | Last target, unless the position's own take-profit is further |
| R in points for a position without a stop | 300 | Used when a position has no stop loss |
| Give a position without a stop a 1R stop | false | true = the EA adds a stop at 1R |
| Management | ||
| % of the original volume closed at TP1 | 40 | 0 = no partial close at TP1 |
| % of the original volume closed at TP2 | 30 | TP1% + TP2% must be 100 or less |
| Break-even: stop to entry + this many points at TP1 | 10 | Points on the profit side |
| Ladder: after each further level the stop goes to the previous one | true | false = the stop stays at break-even |
| Close all managed positions at this server time, e.g. 23:40 (empty = off) | (empty) | Once per trading day |
| Account guard (whole account) | ||
| Daily loss limit, % of the day-start balance (0 = off) | 5.0 | Closed + floating loss today |
| Daily loss limit in account currency (0 = off; the smaller limit wins) | 0 | Fixed amount |
| Max drawdown % from the equity peak (0 = off) | 10.0 | Lock until Unlock is pressed |
| Static drawdown from the starting balance (prop-firm style) | false | true = the peak stays at the starting balance |
| Max new trades per day (0 = off) | 0 | Trades over the cap are closed |
| Trading day starts at this server hour | 0 | For the daily limit and the trades count |
| Display and tester | ||
| Draw TP1 / TP2 / LAST lines on this chart | true | |
| Recolour this chart dark | false | |
| Save a screenshot to MQL5\Files 5 s after start | false | |
| Strategy tester: open demo trades to show the management | true | Tester only |
| Strategy tester: bars between demo trades | 48 | Tester only |
FAQ
Does LadderGuard open trades or give signals?
No. It manages positions you (or another EA) opened, and it guards the account. The only trades it opens are the demo trades in the Strategy Tester, so you can see what it does.
Will it make my trading profitable?
No tool can promise that. LadderGuard applies your exit rules and your risk limits the same way every time, without hesitation. Whether that helps depends on your entries and your settings.
Does it work with other Expert Advisors?
Yes. Use the magic filter to choose which positions it manages: -1 for all, 0 for manual trades only, or one EA's magic number. The guard always looks at the whole account.
Hedging or netting accounts?
Both. On a netting account a partial close is sent as an opposite deal for that volume.
What if my position has no stop loss?
R is then a fixed number of points (input, 300 by default). The EA does not add a stop unless you set "Give a position without a stop a 1R stop" to true.
Why was the partial close at TP1 skipped?
A partial close needs a volume the broker accepts. With a 0.01-lot position on a broker whose minimum is 0.01, there is nothing to split: the stop still moves to break-even, but no partial close is made.
Can I use it for prop-firm rules?
It has the usual tools: a daily loss limit in % or money, a static drawdown from the starting balance, and a trading-day start hour. Check your firm's exact rules and set the inputs to match. The guard closes at market, so in a fast market or a gap the final loss can go past the limit.
What happens after a restart?
The levels and the stage of every position are saved in the terminal's global variables, so it continues where it was. The drawdown peak and the locks are saved too.
Why did a position close at the last target without the partial closes?
TP1 and TP2 are kept by the EA, not by the broker. If the price jumps past them in one move (news, a gap), the broker's take-profit at the last target can close the whole position before the EA gets a tick to act on.
Do I need a VPS?
TP1, TP2 and the guard work only while the terminal and the EA are running. If you close the terminal, the broker still holds your stop loss and take-profit, but nothing else. A VPS keeps it running.
Can I stop the guard for a while?
Yes: press Guard OFF on the panel. The trade manager keeps working.
