Skip to content
All library documents

Temporarily Suspending and Restoring Stops Around News in MQL5

Article MQL5 articles

Summary

This article describes an MQL5 position-management layer for open trades during restricted economic-news windows. It stores each position's original stop-loss and take-profit values by ticket, removes those levels when the window begins, and restores them after it ends. A state flag is intended to prevent repeated modifications during the same window. If price has not crossed a stored level, the method restores it; if it has, restoration uses a nearby valid level that respects broker distance constraints.

The design is presented as a rule-based complement to a separate filter that blocks new entries around high-impact releases. The article explains the workflow and implementation requirements, but supplies no measured results showing that it reduces losses or improves strategy performance. Its limitations are material: positions temporarily have no hard stop protection, restoration depends on broker execution rules, and the implementation is scoped to single-symbol use. It recommends filtering affected trades by the EA's magic number and notes that suspended state is not yet persistent across restarts.

Key ideas

  • The method stores original stop and target values for each suspended position using its ticket.
  • A state flag helps ensure suspension and restoration occur once per news-window cycle.
  • Uncrossed levels are restored at their original prices; crossed levels require a valid nearby placement.
  • Broker minimum stop distances constrain restoration.
  • Removing stops creates temporary unprotected exposure, and the described implementation is intended for single-symbol EAs.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.