There are eight threads on the board about getting an EA or a trade tool to respect the calendar automatically. They range from a plain CSV of times to the MQL5 calendar API, and the useful parts are the design details people learned the hard way. Here's the summary.
Fixed times or a calendar?
The EA news filter thread compares the two. A fixed list of blocked times, like 30 minutes around 13:30 GMT, is simple but blocks quiet days and misses events at other times. A calendar file is better: a plain CSV with one event per line, date, time in GMT, currency and impact, updated weekly. A reply found a flat 30 minutes either side of every high-impact event was too much on some days and too little on others, and moved to windows per event class.
The built-in MT5 calendar
The MQL5 calendar functions thread covers the API: CalendarValueHistory to get events in a time range, CalendarEventById for details including importance. Its practical tip is about testing. The live calendar doesn't help in the strategy tester, so export historical calendar data once from an external source and load it as a file. Then the same filter logic can be tested and used live.
Design rules for auto-disable
The calendar API thread is the most useful on design:
- Blackout minutes configurable per event class.
- Log every disable and enable.
- Don't auto re-enable into a spread that's still wide. Add a spread check before trading resumes.
- Fail closed. If the calendar feed dies, trading is disabled, not enabled.
Spread and calendar together
The spread filters thread defines how the two rules interact. The calendar blackout is the floor: you're flat for the written window regardless of spread. The spread filter can only extend the blackout, never shorten it. A reply asks what "normalised" means. If it means the first tick under the cap, one tight quote in a still-chaotic market can switch trading back on, so require the spread to stay under the cap for a set time.
Platform calendars as a backup
Three threads treat platform calendars as secondary. The MT5 plugin thread uses it as a clock and reminder, with times checked against London local and a personal news map winning any disagreement. The IC events filter thread calls the in-platform filter a seatbelt, not the steering wheel, because it sometimes misses events or rates them differently from your own pair map. The chart integration thread lists the benefits, seeing releases before entering and reviewing past reactions, and the same limits: impact ratings differ between providers and time zone mismatches are common.
Discretionary seatbelts
The auto-flat thread asks about a lighter version for manual traders: not a full EA, just a tool that blocks new orders inside a blackout. Its open question was which feeds are reliable enough not to false-flat you all week, which is exactly what the staleness check addresses.
The threads agree: automate the blackout, but keep your own calendar as the source of truth.
For those running a news filter in code, which calendar source do you trust, and how do you handle it going stale?
Threads this pulls from
- News filter in an EA, using a calendar file vs just blocking fixed times
- MQL5 Calendar Functions: CalendarValueHistory for a News Pause
- Calendar API into EA for auto-disable
- News injectors and calendar APIs for auto-flat
- Using economic calendar plugin inside MT5
- IC Markets economic events filter inside platform vs external
- Economic Calendar Integration on Charts
- How spread filters interact with news blackout rules