News filter in an EA, using a calendar file vs just blocking fixed times
my EA used to trade through everything and the worst fills were all around red folder news. I added a news filter, and I tried two ways of doing it.
The first was a simple list of times: no new trades for X minutes before and after specific times, like the 13:30 GMT US data. It works for the recurring ones, but it misses unscheduled changes and anything that moves around, like central bank speakers.
The second was reading a calendar file, which I update weekly, with the date, time, currency and impact for each event. The EA checks if the pair involves that currency and the impact is high and then it blocks trading for a window around it. It's more work to maintain but way more complete.
Both are only as good as the data. I noticed times in some free calendars were wrong by an hour around daylight saving changes, so I verify the week's events manually. I also close or move to breakeven open trades before the event instead of leaving them exposed.
News filter in an EA, using a calendar file vs just blocking fixed times
Re: News filter in an EA, using a calendar file vs just blocking fixed times
For anyone building the calendar file approach, I keep it as a plain CSV with one event per line: date, time in GMT, currency and impact. I update it every Sunday from a calendar I trust and double check the times. The EA reads the file when it starts and again once a day. Keeping the file simple means I can edit it in a text editor in a couple of minutes, and if something unscheduled is announced midweek I can add a line and the EA picks it up.
It’s Fairman 
Re: News filter in an EA, using a calendar file vs just blocking fixed times
On the window size, I started with thirty minutes either side of every high impact event and found that was too much on some days and not enough on others. Now I use a longer window for the big ones like rate decisions and payrolls, and a shorter one for second tier data. It is a bit more work to set up, but the EA trades more on quiet news days and stays out longer on the really dangerous ones.
It’s Fairman 