Gold (XAUUSD) and the USD pairs can move hundreds of points in the first seconds after a high impact release. This EA reads the economic calendar built into MetaTrader 5 and, a few seconds before each release of the chart currencies, places a Buy Stop above the price and a Sell Stop below it, 100 points away by default.
When one side is filled the other one is deleted (one cancels the other). If nothing is filled, both orders are deleted 60 seconds after the release. Each trade has its own stop loss and take profit in points, and a trailing stop takes over once the trade is in profit.
News slippage is real. On a fast release the stop order can fill far from its price and the spread can widen a lot, so test it on a demo account with your broker before going live.

The MT5 economic calendar, which needs a live connection. The calendar does not run in the Strategy Tester, so the EA places no orders there and you have to try it on a demo account. Any symbol whose base or profit currency is in the list. Distances, stop loss and take profit are raised to the broker minimum stop level when they are below it. Free margin for both orders is checked before anything is sent, and the news is skipped if it is not enough. After a restart it takes back its own pending orders by magic number and does not place a second pair for the same release.
Try it on a demo account on XAUUSD, EURUSD, GBPUSD, US30 or NAS100 around NFP, CPI or the rate decisions and look at the real fill price and spread of your broker in those seconds. Then adjust the distance and the stop loss to that symbol. A risk based lot, a daily loss limit or a filter that only trades a list of event names are easy additions. PlaceSet, ManageSets and Trailing are short functions you can copy into your own EA, and LoadCurrency is a clean example of reading CalendarValueHistory.
Open source. Use it as it is, adapt it, build your own version on top of it. New versions and new tools are announced first on my MQL5 channel: https://www.mql5.com/en/channels/xander. Questions, suggestions and your own tests are welcome in the Xander Lab group: https://www.mql5.com/en/messages/02eec85e4364dd01. More tools on my profile: https://www.mql5.com/en/users/09151993a. Provided as is, use at your own risk.
Related: Daily Loss and Profit Lock, Opening Range Breakout EA Gold, Trailing Stop Breakeven Manager, Risk Lot Size Calculator Panel.
v1.0 (2026-11-20): initial release.
PDH PDL Sweep Levels
Previous day high and low indicator for MT5 on Gold (XAUUSD), forex and indices: PDH, PDL, previous week high and low, day and week open, and an arrow when a closed candle sweeps a level and closes back inside. Open source code.
Daily Loss and Profit Lock
Daily loss limit EA for MT5 on prop firm and funded accounts, Gold (XAUUSD), forex and indices: closes every position at the daily loss or profit limit, deletes pending orders and locks trading until the next day. Open source code.
Accelerator Oscillator (AC)
The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.
MACD Signals
Indicator edition for new platform.