MT5 Display of Aggregate Stop-Loss and Take-Profit Values
Summary
This MT5 expert advisor estimates and displays the combined monetary value associated with stop-loss and take-profit levels across currently open positions. It iterates through positions with a nonzero stop or target, uses each position’s entry-to-level distance, volume, and symbol tick-value information, and includes swap in its calculation. The totals appear in a chart label and are refreshed when a tick changes either value.
The tool is informational: it does not open, alter, or close trades. Its display can help a trader view the combined exposure implied by existing exits across positions. The document provides implementation details but no validation against broker calculations or live outcomes. The calculation relies on symbol metadata and a pip multiplier derived from decimal precision, so its accuracy may depend on instrument conventions and account currency; it should be treated as an estimate rather than a guaranteed payoff.
Key ideas
- The advisor sums estimated stop-loss and take-profit values across open positions that have the corresponding level set.
- It estimates value using entry-to-exit distance, position volume, and symbol tick data.
- Swap is included in the per-position calculation.
- The displayed totals update on ticks when the calculated values change.
- The tool only reports information and does not modify trades.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.