Spread-Compensated Breakeven Stops with Correct Pip Conversion
Summary
The article presents a reusable MQL5 breakeven manager intended to avoid stop-outs caused by spread widening after a stop is moved to the entry price. It measures the live spread when modifying the stop, converts pip values using symbol digits, and calculates long and short breakeven levels by including the spread and any configured buffer. The module tracks each position in a record, activates after a specified profit threshold, and provides a manager interface called by the Expert Advisor on each tick.
The article describes separate components for spread sampling, calculation, execution, and position state, along with a demo EA and verification script for pip conversion, formulas, activation, and one-time movement. It states that the manager does not include swap costs, adaptive thresholds, retry backoff, or automatic stop readjustment after a successful move. The described checks support implementation behavior, but the text does not present broad market testing or evidence that spread compensation alone guarantees a net break-even exit under all fees and execution conditions.
Key ideas
- The breakeven level includes the live spread and a configurable pip buffer.
- Pip size is derived from symbol digits to handle three- and five-digit quotes correctly.
- The manager keeps configuration and movement state separately for each registered position.
- A verification script checks conversion, level calculations, activation, and movement gating.
- The described implementation excludes swap costs, adaptive thresholds, retries, and later stop adjustments.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.