You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Designing a Partial Close Engine in MQL5 with Configurable Profit Ladders.
This MQL5 engine applies configurable profit ladders in R‑multiples to manage partial closes reliably. It prevents stranded remainders by rounding to lot step, computes close percentages from the original entry volume, and moves the stop to breakeven when configured. A supported filling mode is chosen automatically, and the download includes seven include files, a demo EA, and a verification script.
Partial position closing means scaling out of a winning trade at multiple profit targets rather than exiting all at once. It is a standard risk management technique among professional traders, but most retail MQL5 Expert Advisors either skip it entirely or get the mechanics wrong in ways that only show up once real money is on the line.
Three mistakes recur in custom implementations: (1) failing to round the close volume to the lot step, (2) applying percentages to the remaining volume instead of the entry volume, and (3) mishandling the move to breakeven after the first partial close. This leaves the remaining position sitting at its original stop, exposed to a full loss even after the trade has already covered its own risk.
This article builds a CPartialCloseEngine class that solves all three problems directly. It accepts an R-multiple profit ladder, monitors registered positions on each tick, computes a close volume that respects lot step and minimum lot, and moves the stop to breakeven when a ladder level requests it. By the end, you will have nine source files: seven include files, one Expert Advisor, and one verification script you can compile and run.
Author: Ushana Kevin Iorkumbul