
A take profit split in five steps for any open position on MetaTrader 5, on Gold (XAUUSD), EURUSD, indices or crypto. You set the distance of TP1 to TP5 in points or in multiples of the stop loss (R) and the percent of the initial lot to close at each one. The EA watches manual trades and positions opened by any other expert, filtered by magic number, and closes the partial the moment price reaches each level.
After the level you choose the stop loss moves to breakeven plus an offset, and an optional trailing stop follows price from there. A position with no stop loss can receive one automatically. The levels already taken are stored in terminal global variables, so a restart of the terminal does not repeat a partial close.
It never opens a trade. Partial volumes are rounded to the broker lot step, and when the remainder would be smaller than the minimum lot the position is closed in full. Run it on a demo account with your own symbols and your own lot sizes before using it on a live one.
Strategy
Close / Exit
Risk Protection
Filters
Expert Settings
Attach it to the chart where you trade by hand on Gold (XAUUSD), EURUSD, GBPUSD, US30, NAS100 or BTCUSD and let it take the partials while you watch the next setup. Put it next to a scalping or grid EA that only knows one take profit and give that EA five. In R mode it turns a stop loss into a risk reward ladder, 1R, 2R, 3R, that fits any Smart Money Concepts, supply and demand or support and resistance entry. The functions XP_CloseVolume, XP_BreakEven and XP_Trailing are self contained, copy them into your own expert advisor or trade manager when you need a partial close that respects the lot step and the broker stops level.
Open source. Use it as it is, adapt it, build your own version on top of it.
New versions and new tools are announced first on my MQL5 channel: https://www.mql5.com/en/channels/xander
Questions, suggestions and your own tests are welcome in the Xander Lab group: https://www.mql5.com/en/messages/02eec85e4364dd01
More tools on my profile: https://www.mql5.com/en/users/09151993a
Swap Markup Scanner
Shows the broker's hidden financing markup and the carry for every symbol, as annual % of notional.
DataSnooping: SPA test, Reality Check, StepM and model confidence set
Is the best of many strategies really better than the benchmark? Hansen's SPA test, White's Reality Check, Romano-Wolf StepM and the model confidence set.
Broker GMT offset and daylight-time rule from price history
Detects the broker's GMT offset and its daylight-time rule (fixed, US or European) from the weekly closes in the H1 history, the same way live and in the Strategy Tester, with functions that convert New York times to server time and back.
ADX Auto Range
Range boxes that are drawn when market trend strength weakens