All about Calendar tab and Macro Economic Events. - page 7

 

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

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

In Part 1 we introduced a news-filter that blocks new trade entries during high‑impact events. That layer reduces entry exposure to abnormal volatility, but does not address the remaining issue: trades opened before the news window still experience widened spreads, transient spikes, and temporary distortions that can trigger SL/TP levels prematurely. Closing all positions before every news event is often not acceptable — it breaks trade structure, skews statistics, and conflicts with longer‑term logic.

This article addresses that specific engineering problem: how to add a controlled, reversible stop‑management layer that temporarily suspends stop‑loss and take‑profit levels for already open positions during the restricted news window and then restores them deterministically afterwards. The success criteria are explicit: actions must occur once per news window (no repeated modifications), original SL/TP values must be preserved and restored when technically possible, broker stop‑distance rules must be respected (no invalid placements), and the mechanism must be filterable by the EA (magic number) and clearly scoped (and the single‑symbol behavior is documented). The goal is mitigation of premature stop‑outs — not prediction of market direction.

Using the MQL5 Economic Calendar for News Filtering (Part 1): Implementing Pre- and Post-News Windows in MQL5
Using the MQL5 Economic Calendar for News Filtering (Part 1): Implementing Pre- and Post-News Windows in MQL5
  • 2026.02.18
  • www.mql5.com
We build a calendar‑driven news filter entirely in MQL5, avoiding web requests and external DLLs. Part 1 covers loading and caching events, mapping them to symbols by currency, filtering by impact level, defining pre/post windows, and blocking new trades during active news, with optional pre‑news position closure. The result is a configurable, prop‑firm‑friendly control that reduces false pauses and protects entries during volatility.
 

Using the MQL5 Economic Calendar for News Filter (Part 3): Surviving Terminal Restarts During News Window

Using the MQL5 Economic Calendar for News Filter (Part 3): Surviving Terminal Restarts During News Window

We already have a news filter that temporarily removes SL/TP and restores them after a news window in Part 2 of this series. The existing implementation, however, keeps its state only in memory: savedStops[] and the newsSuspended flag. If a restart or recompile occurs between SuspendStops(true) and SuspendStops(false), that in-memory state is lost. The EA no longer identify which positions had their stops removed. The result: open positions may remain unprotected or never be restored, and without a recovery mechanism, the system cannot safely reconstruct its previous state.

To address this, we define a recovery contract. The system must persist trade state externally: ticket IDs, stop levels, and suspension status. Upon reinitialization, this data must be restored accurately, ensuring that the system resumes operation without prematurely restoring stops or leaving trades unprotected.

Using the MQL5 Economic Calendar for News Filter (Part 3): Surviving Terminal Restarts During News Window
Using the MQL5 Economic Calendar for News Filter (Part 3): Surviving Terminal Restarts During News Window
  • 2026.03.31
  • www.mql5.com
The article introduces a restart-safe storage model for news-time stop removal. Suspension state and original SL/TP per position are written to terminal global variables, reconstructed on OnInit, and cleaned after restoration. This lets the EA resume an active suspension window after recompiles or restarts and restore stops only when the news window ends.
 

Using the MQL5 Economic Calendar for News Filter (Part 4): Accurate Backtesting with Static Data

Using the MQL5 Economic Calendar for News Filter (Part 4): Accurate Backtesting with Static Data

In Part 3, we solved the problem of state-loss during terminal restarts by introducing persistent storage using terminal global variables. The news-filter suspension system could now survive a VPS reboot or an EA recompile without losing track of which trades had their stops removed. That was a big step toward operational robustness.
Using the MQL5 Economic Calendar for News Filter (Part 4): Accurate Backtesting with Static Data
Using the MQL5 Economic Calendar for News Filter (Part 4): Accurate Backtesting with Static Data
  • 2026.04.28
  • www.mql5.com
This article implements a static, CSV-based news source for the Strategy Tester, so historical economic news events can be preloaded and queried during backtesting. It replaces live calendar calls in tester mode with a fast in-memory search, preserves the live logic for trading, and delivers deterministic, repeatable results with explicit control over included events, enabling reliable validation of news-aware filters, stop suspension, and trade-blocking rules.