Discussing the article: "Using the MQL5 Economic Calendar for News Filtering (Part 2): Stop Management Positions During News Releases"

 

Check out the new article: Using the MQL5 Economic Calendar for News Filtering (Part 2): Stop Management Positions During News Releases.

In part 2, we extend the news filter to protect existing positions during news events. Instead of closing trades, we temporarily remove stop-loss and take-profit levels, storing them safely in memory. When the news window ends, stops are deterministically restored, adjusted if price has already crossed the original levels, while respecting broker minimum distance rules. The result is a mechanism that preserves trade integrity without interfering with entry logic, keeping the EA in control through volatility.

The objective of Part 2 is strictly defined to temporarily suspend stop-loss and take-profit levels during the restricted news window and restore them safely once the window ends.

This approach does not attempt to interpret the direction of the news. It only prevents premature stop-outs caused by abnormal market conditions.

Principles of stop restoration

The restoration logic is deterministic:

  • If price has not crossed the original stored stop-loss or take-profit level, the stop is restored exactly at its original value.
  • If price has already moved beyond the original stop-loss level, the stop is restored at the nearest valid level just in front of the current price.
  • The same logic is applied to take-profit levels.

This ensures:

  • no invalid stop placement,
  • no broker rejection due to crossed price levels,
  • no restoration of logically impossible values, and
  • preservation of original trade structure whenever technically feasible.

The mechanism remains rule-based.

Author: Solomon Anietie Sunday