Filtering Economic News and Managing Stop-Order Entries in an MQL5 EA
Summary
This installment extends an MQL5 news-trading expert advisor with selectable event filters and stop-order entry settings. Traders can choose custom groups of event IDs or filter calendar events by importance, frequency, sector, type, and currency. Database queries retrieve matching events, while added views track recent and upcoming dates for each event. The article also describes using event impact to choose a buy-stop or sell-stop direction and a price deviation as a buffer for order placement.
The code updates in-memory calendar retrieval to optionally include historical and forecast values for impact assessment, and connects trade execution to functions that remove opposite pending orders and reduce slippage for non-market entries. The evidence is an implementation walkthrough with MQL5 and SQL excerpts, rather than reported trading results. Its scope is software design: it does not establish that the event filters, impact estimates, or execution changes produce profitable trades. The article also assumes selected events have an identifiable impact when determining order direction.
Key ideas
- The EA can filter calendar data either by custom event IDs or by several built-in news settings.
- Separate database views can expose recent and upcoming dates for calendar events.
- Stop-order direction is selected using event impact, with a user-set price deviation as a buffer.
- The execution logic removes opposite pending orders for stop-order trading and applies slippage reduction to non-market entries.
- The article describes implementation details but provides no performance evidence for the resulting strategy.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.